5 Replies Latest reply on Feb 2, 2011 1:49 PM by Flex harUI

    Spark DataGrid two way binding

    Zolotoj Level 3

      I am having a problem with two binding in the Spark DataGrid.

      Here is a code fragment:

      <s:DataGrid requestedRowCount="4" fontSize="11" sortableColumns="false"
                                         id="engines" rowHeight="22" 
                                         height="100%">
                               <s:columns>
                                    <s:ArrayList>
                                         <s:GridColumn headerText="Initial" width="50">
                                              <s:itemRenderer>
                                                   <fx:Component>
                                                        <s:GridItemRenderer>
                                                             <s:layout>
                                                                  <s:VerticalLayout paddingLeft="2" 
                                                                                        verticalAlign="middle"/>
                                                             </s:layout>
                                                             <s:TextInput restrict="a-zA-Z" text="@{XML(data).initial}"/>
                                                        </s:GridItemRenderer>
                                                   </fx:Component>
                                              </s:itemRenderer>
                                         </s:GridColumn>
      

       

      As you can see I am using a TextInput as a custom renderer. While this solution basically works however typing into a text field defined by a custom renderer has some strange problem: after each character being typed I have to click on the text field to get a focus back to continue typing. Any idea why that is happening?

       

      Thanks