What does updateCorrectAnswer? It would be helpful if you give us some
working example to test what's going on.
Do you really need data.correct=!data.correct;?
Maybe you could just call outerDocument.updateCorrectAnswer(!data.correct,
data.id);

Probably that's not the reason of this behavior, but it's hard to guess for
me.

R.

On 3/13/07, Xia Zhao <[EMAIL PROTECTED]> wrote:

   Hello,

I use radio button as data grid itemRenderer. The short code is at the
end. What I want to do is adding answers for one question and set the
correct answer. I attched the screen shot. I use the check box and text
input on the top line to add an answer. Once I click Add this answer button,
the answer will appear in the bottom datagrid. And if it is the correct
answer, the radio button in front should be selected. There are some
problems here:

1) If I set the entered answer as the correct answer, after I click "Add
this answer" button, the radio button in front of this answer is not
selected immediately. When I add the next answer and click "Add this answer"
button, the selection for the previous radio button appears.

2) Connect with the first problem I think, if I set the last answer as the
correct answer, the radio button will keep appear then disppear when I
refresh the answer list. Refresh I mean read data from collection.

I tried to debug and traced the value of the correct answer. I boolean
value is correct but the radio button is not rendered correctly with the
value.

Does anyone have any idea about this?

BTW, I am using Flex 2.0.1 and Caringorm2.1.

Xia



<mx:DataGridColumn
dataField="correct" width="32 ">

<mx:itemRenderer>

<mx:Component>

<mx:RadioButton selected="{data.correct }" click="
data.correct=!data.correct;outerDocument.updateCorrectAnswer(data.correct,
data.id )"/>

</mx:Component>

</mx:itemRenderer>

</mx:DataGridColumn>



Reply via email to