Monday, May 12, 2008

Help me... Stuck with checkbox in Flex!

We recently switched from OpenLaszlo to Flex to implement the UI for Continuum. Let me just start by saying that Flex UI is very clean. It doesn't depend on browser and the script is much like Java. So far so good!

To play around with Flex, we started with creating a window in the browser. The aim was to get acquainted with Flex. Creating windows was easy. Now came the tough part, moving and resizing the window. Here comes the first hiccup! Everybody starts to type in keywords frantically on Google. The question was how to build resizable and draggable in Flex. Then suddenly I heard a excited voice "Got it". Somebody had found some help. Here is the URL from Flex team Creating Resizable and Draggable components in Flex

Now the next thing to set a checkbox as per the data in the dataset. We are still stuck at this.

The checkbox is not enabling or disabling as per the value set in the dataset.
Can somebody please tell me whats wrong...?

<mx:XMLList id="gridData" xmlns="">
<contents>
<content check="false" name="test1.txt" size="2100" dateOfModified="01/Apr/2008" modifiedBy="kirana"/>
<content check="false" name="test2.txt" size="2100" dateOfModified="01/Apr/2008" modifiedBy="kirana"/>
<content check="false" name="test4.txt" size="2100" dateOfModified="01/Apr/2008" modifiedBy="kirana"/>
</contents>
</mx:XMLList>

<mx:DataGrid dataProvider="gridData">
<mx:DataGridColumn headerText="Select?">
<mx:itemRenderer>
<mx:Component>
<mx:CheckBox selected="{data.@check}" selectedField="@check"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:DataGrid>

Any help is appreciated!

No comments: