RE: [flexcoders] Activate Component (enable)
BTW, on the itemRenderer problem with the TypeError: Error #1034: Type Coercion failed_it would seem that error is a pretty generic one. I say that because in the google search on it not one of the results on the entire first page had anything to do with itemRenderers and in fact seem all unrelated to each other. Just to let you know I do try to find the solution first before I ask others.
RE: [flexcoders] Activate Component (enable)
I'm sorry. I wasn't clear. I want the button to enable a component (or disable it in the case of the reset button). The component is in the same MXML file. What seems to work seems pretty involved. I had to bind a variable in the component and bind one in the main MXML to pass the state (enabled) in. The next problem I have is probably simpler, but following two matching google solutions that failed to work means there is probably a depth to this problem beyond my ignorance. I just want a check box or radio button to be included in a grid. Both solutions that I tried looked like this: cust:MyAdvancedDataGrid id=dgData width=100% height=85% textAlign=center fontWeight=normal dataProvider={myData} selectionMode=singleCell accessibilityName=Case Composition, DataGrid, use arrow keys to navigate between cells cust:columns mx:AdvancedDataGridColumn headerText=Select rendererIsEditor=true width=100 mx:itemRenderer fx:Component s:CheckBox selected=false/ /fx:Component /mx:itemRenderer /mx:AdvancedDataGridColumn It seems straight forward. Add an itemRenderer as the content of a cell. To enable the control, add a FX container. It doesn't cause any syntax error, but when you run it you get this: TypeError: Error #1034: Type Coercion failed: cannot convert gov.il.dhs.wvs.view.components::UserAA_GridInnerClass0@7cb6cf1 to mx.controls.listClasses.IListItemRenderer. at mx.controls.advancedDataGridClasses::AdvancedDataGridBase/http://www.ado be.com/2006/flex/mx/internal::columnItemRenderer()[E:\dev\4.x\frameworks \projects\datavisualization\src\mx\controls\advancedDataGridClasses\Adva ncedDataGridBase.as:1634] at mx.controls::AdvancedDataGridBaseEx/http://www.adobe.com/2006/flex/mx/in ternal::getMeasuringRenderer()[E:\dev\4.x\frameworks\projects\datavisual ization\src\mx\controls\AdvancedDataGridBaseEx.as:2812] at mx.controls::AdvancedDataGrid/http://www.adobe.com/2006/flex/mx/internal ::getMeasuringRenderer()[E:\dev\4.x\frameworks\projects\datavisualizatio n\src\mx\controls\AdvancedDataGrid.as:4152] at mx.controls::AdvancedDataGridBaseEx/measureItems()[E:\dev\4.x\frameworks \projects\datavisualization\src\mx\controls\AdvancedDataGridBaseEx.as:62 25] at mx.controls::AdvancedDataGridBaseEx/commitProperties()[E:\dev\4.x\framew orks\projects\datavisualization\src\mx\controls\AdvancedDataGridBaseEx.a s:2274] at mx.controls::AdvancedDataGrid/commitProperties()[E:\dev\4.x\frameworks\p rojects\datavisualization\src\mx\controls\AdvancedDataGrid.as:2846] at mx.core::UIComponent/validateProperties()[E:\dev\4.x\frameworks\projects \framework\src\mx\core\UIComponent.as:7933] at mx.managers::LayoutManager/validateProperties()[E:\dev\4.x\frameworks\pr ojects\framework\src\mx\managers\LayoutManager.as:572] at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.x\frameworks \projects\framework\src\mx\managers\LayoutManager.as:730] at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.x\fr ameworks\projects\framework\src\mx\managers\LayoutManager.as:1072] From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Alex Harui Sent: Friday, June 08, 2012 3:41 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Activate Component (enable) 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 jerry.david...@illinois.gov wrote: I couldn't see how to get to the property from the button. From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Alex Harui Sent: Friday, June 08, 2012 11:56 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Activate Component (enable) Why wouldn't you set enabled=true on the button click
Re: [flexcoders] Activate Component (enable)
A reset button would make it a bit more complicated. Having a data model would be a recommended solution. I would start a new thread about the datagrid problem, but basically, Spark components are not drop-in itemrenderers like MX components. On 6/12/12 6:40 AM, Davidson, Jerry jerry.david...@illinois.gov wrote: I’m sorry. I wasn’t clear. I want the button to enable a component (or disable it in the case of the reset button). The component is in the same MXML file. What seems to work seems pretty involved. I had to bind a variable in the component and bind one in the main MXML to pass the state (enabled) in. The next problem I have is probably simpler, but following two matching google solutions that failed to work means there is probably a depth to this problem beyond my ignorance. I just want a check box or radio button to be included in a grid. Both solutions that I tried looked like this: cust:MyAdvancedDataGrid nbs! p; id=dgData width=100% height=85% ! textAlign=center fontWeight=normal o dataProvider={myData} selectionMode=! singleCell accessibilityName=Case Composition, DataGrid, use arrow keys to navigate between cells ! cust:columns mx:AdvancedDataGridColumn headerText=Select rendererIsEditor=tr! ue width=100 !mx:itemRenderer fx:Component n! bsp; nbs! p; s:CheckBox selected=false/ ! nbsp;/fx:Component /mx:itemRenderer ! nbsp; nb! sp; ; /mx:AdvancedDataGridColumn It seems straight forward. Add an itemRenderer as the content of a cell. To enable the control, add a “FX” container. It doesn’t cause any syntax error, but when you run it you get this: TypeError: Error #1034: Type Coercion failed: cannot convert gov.il.dhs.wvs.view.components::UserAA_GridInnerClass0@7cb6cf1 to mx.controls.listClasses.IListItemRenderer. at mx.controls.advancedDataGridClasses::AdvancedDataGridBase/http://www.adobe.com/2006/flex/mx/internal::columnItemRenderer()[E:\dev\4.x\frameworks\projects\datavisualization\src\mx\controls\advancedDataGridClasses\AdvancedDataGridBase.as:1634] at mx.controls::AdvancedDataGridBaseEx/http://www.adobe.com/2006/flex/mx/internal::getMeasuringRenderer()[E:\dev\4.x\frameworks\projects\datavisualization\src\mx\controls\AdvancedDataGridBaseEx.as:2812] at mx.controls::AdvancedDataGrid/http:! //www.adobe.com/2006/flex/mx/internal::getMeasuringRenderer()[! E:\dev\4 .x\frameworks\projects\datavisualization\src\mx\controls\AdvancedDataGrid.as:4152] at mx.controls::AdvancedDataGridBaseEx/measureItems()[E:\dev\4.x\frameworks\projects\datavisualization\src\mx\controls\AdvancedDataGridBaseEx.as:6225] at mx.controls::AdvancedDataGridBaseEx/commitProperties()[E:\dev\4.x\frameworks\projects\datavisualization\src\mx\controls\AdvancedDataGridBaseEx.as:2274] at mx.controls::AdvancedDataGrid/commitProperties()[E:\dev\4.x\frameworks\p! rojects\datavisualization\src\mx\controls\AdvancedDataGrid.as:2846] at mx.core::UIComponent/validateProperties()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:7933] at mx.managers::LayoutManager/validateProperties()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:572] at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:730]! at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1072] From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Alex Harui Sent: Friday, June 08, 2012 3:41 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Activate Component (enable) 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 jerry.david...@illinois.gov wrote: I couldn’t see how to get to the property from the button. n! bsp; F! rom: flexcoders@yahoogroups.com
[flexcoders] Activate Component (enable)
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 Select office: SelectNameCase Office Select case: [ ]x x x Select from date: [ ]y y y Select to date: [ ]z z z Search Btn Details Start EndStuff More Stuff 1 1 1 1 2 2 2 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 variable 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
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 jerry.david...@illinois.gov 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 Select office: SelectNameCase Office Select case: nbs! p; [ ] n! bsp;nbs p; x x x Select from date: [ ]y y y ! nbsp; Select to date: [ ]z z z Search Btn n! bsp; Details Start EndStuff More Stuff ! nbsp; 1 1 1 1 ! nbsp; nb! sp; ; 2 2 2 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
RE: [flexcoders] Activate Component (enable)
I think I've found a solution that I'll pass on. UserAA has a bindable Boolean variable that is used to set a property in the component. That property is bound to the enabled property of the container. From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Davidson, Jerry Sent: Friday, June 08, 2012 8:57 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Activate Component (enable) 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 Select office: SelectNameCase Office Select case: [ ]x x x Select from date: [ ]y y y Select to date: [ ]z z z Search Btn Details Start EndStuff More Stuff 1 1 1 1 2 2 2 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 variable 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
RE: [flexcoders] Activate Component (enable)
I couldn't see how to get to the property from the button. From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Alex Harui Sent: Friday, June 08, 2012 11:56 AM To: flexcoders@yahoogroups.com 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 jerry.david...@illinois.gov 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 Select office: SelectNameCase Office Select case: nbs! p; [ ] n! bsp;nbs p; x x x Select from date: [ ]y y y ! nbsp; Select to date: [ ]z z z Search Btn n! bsp; Details Start EndStuff More Stuff ! nbsp; 1 1 1 1 ! nbsp; nb! sp; ;2 2 2 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
Re: [flexcoders] Activate Component (enable)
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 jerry.david...@illinois.gov wrote: I couldn’t see how to get to the property from the button. From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Alex Harui Sent: Friday, June 08, 2012 11:56 AM To: flexcoders@yahoogroups.com 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! jerry.david...@illinois.gov 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: SelectNameCase 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 EndStuff More Stuff ! nbsp; nb! sp; 1 nb! sp; ; 1 1 1 ! nbsp; nb! sp; ; 2 2 2nb! 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