Assuming the button and ting you want to enable are in the same MXML file a
typical set up looks like
<mx:Button label=”enable text search” click=”criteria.enabled = true” />
<mx:TextInput id=”criteria” enabled=false” />
Even more common is the use of checkboxes for enabling
<mx:CheckBox label=”enable text search” id=”enableTextSearch” />
<mx:TextInput enabled=”{enableTextSearch.selected}” />
In which case you can just use binding.
On 6/8/12 12:19 PM, "Davidson, Jerry" <[email protected]> wrote:
I couldn’t see how to get to the property from the button.
From: [email protected] [mailto:[email protected]] On Behalf
Of Alex Harui
Sent: Friday, June 08, 2012 11:56 AM
To: [email protected]
Subject: Re: [flexcoders] Activate Component (enable)
Why wouldn’t you set enabled=true on the button click?
On 6/8/12 6:56 AM, "Davidson, Jerry! " <[email protected]> wrote:
I have a form that includes a component. The form includes selection criteria
and a search button. When the user clicks the search button, I want to enable
the component and populate a grid of the results of the search. Taking baby
steps, the first thing I want to do is the enabling.
Search Results
&nbs! p; ! &n bsp; Select office:
Select Name Case Office
Select case: &nbs!
p; [ ] &n! bsp;&nbs p; x ! x x
Select from date: [
] y y y
&! nbsp; Select to date: &nb! sp; ! ; &
nbsp; [ ] z z z
Search Btn &n! bsp;
Details
! ;
Start End Stuff More Stuff
&! nbsp;
&nb! sp; 1 &nb! sp; ; 1 1
1
&! nbsp; &nb! sp; ;
2 2 2 &nb! sp;
2
The results and details sections (in same component) are disabled until a user
selects stuff. Step one is to enable the component when the search button is
clicked and all the edit checks are passed.
I was thinking of passing a boolean in the component bound to a variabl! e that
is defaulted to false and set to true in the search button code, but that
didn’t work. I couldn’t find a property of the component that could be set in
the search button click event.
TIA,
Jerry
--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui