RadioButton on 1st row of DataGrid causing problems - adobe flex

I have a DataGrid with RadioButtons in one column using itemRenderer. The DataGrid resides in a TitleWindow that is created and appears every time the user clicks the button. The DataProvider for the DataGrid is an ArrayCollection, and the RadioButtons are selected or not based on a Boolean value in each ArrayCollection when the window and DataGrid are displayed. If the user clicks another RadioButton in the DataGrid, then the ArrayCollection items are updated with the new boolean values.

The problem is that the RadioButton on the first line keeps its selected value. When using RadioButtons on all other rows when the TitleWindow and DataGrid are displayed, the correct RadioButton is selected based on the Boolean value from the item in the ArrayCollection. But if the first line of the RadioButton is the one that should be selected, it is not. I have set a listener for the valueCommit event on the RadioButtons and the results are interesting: the valueCommit for the RadioButtons on all lines except the first is fired only once, with the selected value being true. But if the RadioButton on the first line is the one that should be selected, valueCommit is triggered 5 times , the first 3 times report the selected value as true and the last 2 times report it as false.

Any help on this would be greatly appreciated. A similar error has been reported but does not provide any workarounds.

UPDATE 12/18/08 OK, valueCommit is fired 5 times, the fourth is false and the fifth false time, which is false, actually corresponds to index 2 in the data ALWAYS no matter what it is. So 4 times the first RadioButton is reported, the last time being fake, and the fifth time the reporting index 2 is reported as being fake. Weird!

+1


source to share


1 answer


Decision. Instead of using RadioButtons as the itemRenderer, I used an image, which is much cleaner and doesn't cause such unpredictable behavior.



0


source







All Articles