[flexcoders] Re: Item Renderer focus on subcomponent in List
I took your example with the DataGrid and slightly modified it to extend a List. The example correctly shows a list and correctly tabs into the first itemRenderer ( rendererIsEditor=true and the MultiField editor is the Renderer). The shift works to tab back out of the first item as well. The error comes when i reach the lastname text box on the first editor and want to go to the second one. It throws a runtime error below. --- ReferenceError: Error #1069: Property text not found on DataGridMultiFieldEditor and there is no default value. at mx.controls::List/itemEditorItemEditEndHandler()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\List.as:2609] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9156] at mx.controls::List/endEdit()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\List.as:2181] at mx.controls::List/deactivateHandler()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\List.as:2397] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9156] at mx.controls::List/endEdit()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\List.as:2181] at mx.controls::List/commitEditedItemPosition()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\List.as:1893] at mx.controls::List/updateDisplayList()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\List.as:1013] at mx.controls.listClasses::ListBase/validateDisplayList()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:3279] at mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:605] at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:678] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8565] at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8508]
[flexcoders] Re: Item Renderer focus on subcomponent in List
I believe I found the problem. I need to rewrite an event to return multiple values from the item editor instead of the default 'text' value. I'll work on this and the tab should work I'm guessing. If it does not I will report back. Thanks for the help again.
[flexcoders] Re: Item Renderer focus on subcomponent in List
I fixed the run time error by writing a function to pass the two text box variables back to the data provider. (ItemEditEnd=func(event);) Fixed it. So now I can tab into the List's first component but once focus is on the first renderer I can only tab and shift between the two boxes in the first renderer. It's like the focus is stuck there. Any ideas. Here is the code I added for the ItemEditEnd function. Not sure if that messes up tabbing and focus. --- public function endEditRenderer(event:ListEvent):void { event.preventDefault(); list.editedItemRenderer.data.first= Renderer(event.currentTarget.itemEditorInstance).firstName.text); list.editedItemRenderer.data.last= Renderer(event.currentTarget.itemEditorInstance).lastName.text; list.destroyItemEditor(); list.dataProvider.itemUpdated(list.editedItemRenderer); }
RE: [flexcoders] Re: Item Renderer focus on subcomponent in List
That sounds like you're still calling preventDefault on the keyFocusChange event. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of boilerman1984 Sent: Tuesday, December 09, 2008 12:16 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Item Renderer focus on subcomponent in List I fixed the run time error by writing a function to pass the two text box variables back to the data provider. (ItemEditEnd=func(event);) Fixed it. So now I can tab into the List's first component but once focus is on the first renderer I can only tab and shift between the two boxes in the first renderer. It's like the focus is stuck there. Any ideas. Here is the code I added for the ItemEditEnd function. Not sure if that messes up tabbing and focus. --- public function endEditRenderer(event:ListEvent):void { event.preventDefault(); list.editedItemRenderer.data.first= Renderer(event.currentTarget.itemEditorInstance).firstName.text); list.editedItemRenderer.data.last= Renderer(event.currentTarget.itemEditorInstance).lastName.text; list.destroyItemEditor(); list.dataProvider.itemUpdated(list.editedItemRenderer); }
[flexcoders] Re: Item Renderer focus on subcomponent in List
Alex, Thanks a bunch. Days of frustrated work make you overlook whats staring you in the face sometimes. In searching for answers I've noticed your work and responses across the flex world. You do excellent work in you blog and responses helping us 'beginners' out.
[flexcoders] Re: Item Renderer focus on subcomponent in List
Thanks that has got me on the right track. Not sure how I overlooked that. Ive got it to focus on the first item inside the item renderer. I now have a problem tabbing to the next item renderer in the list or outside the list. I get a 1069 error. I think I have to modify the keyfocuschange handler but I'm not positive. Any thoughts.
[flexcoders] Re: Item Renderer focus on subcomponent in List
I read and followed the example on your blog about tabbing between two text inputs in the datagrid. This is similar to that, but two text inputs in a render of a list. I don't believe the List functions the same way and I am having trouble transfering what I learned on that to my situation.
RE: [flexcoders] Re: Item Renderer focus on subcomponent in List
The list should work the same way, but I haven't tried it. If you have a simple test case post it. Also post the full text of the error you got. Make sure you're using a debug build so you get line numbers. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of boilerman1984 Sent: Monday, December 08, 2008 12:27 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Item Renderer focus on subcomponent in List I read and followed the example on your blog about tabbing between two text inputs in the datagrid. This is similar to that, but two text inputs in a render of a list. I don't believe the List functions the same way and I am having trouble transfering what I learned on that to my situation.