Hey, thanks for responding.
You guessed correctly. I'm creating a tests and quizzes application that
should be used to test students at my university.
I already tried something similar to the stuff from your response,
unfortunately it doesn't work as expected. The row gets added this time, but
the radio buttons act like they aren't a part of the same radio group. I
guess this is because only one row is updated with the ajax request, so the
radio group and other boxes don't know about the change.
Anyway, I found a workaround that involves submitting the form.
The addrow and remove links submit the whole form via ajax and I do the
stuff I need to differentiate between actions I should take in those
onSelected event handlers.
The tml looks like this:
<t:zone t:id="loopZone" id="loopZone">
<t:form t:id="questionForm" zone="loopZone">
<t:beaneditor object="question" t:id="questioneditor"/>
<div>
<t:radiogroup t:id="correctAnswer" encoder="encoder"
value="correctAnswer" validate="required">
<t:loop source="question.answers" value="answer"
t:id="answerLoop" encoder="encoder">
<t:beaneditor object="answer" t:id="answereditor"
add="remove">
<p:answercorrect>
<t:radio id="radio" value="answer"/>
<t:label for="radio">Correct</t:label>
</p:answercorrect>
<p:remove>
<t:linksubmit t:id="remove"
context="answer"> Remove Row </t:linksubmit>
</p:remove>
</t:beaneditor>
</t:loop>
<t:linksubmit t:id="addRow" t:zone="loopzone"> Add Row
</t:linksubmit>
</t:radiogroup>
</div>
<t:submit t:id="save"/>
</t:form>
</t:zone>
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Radio-button-inside-ajaxformloop-tp5027367p5034294.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]