Questions.jwc:
<form jwcid="@Form">
<span jwcid="@for" source="ognl:questions"
value="ognl:currentQuestion" index="ognl:currentQuestionIndex">
<span jwcid="@QuestionComponent" question="ognl:currentQuestion"
answer="ognl:answers[currentQuestionIndex]"/>
</span>
</form>
add to your Questions.java the abstract getCurrentQuestion and
getCurrentQuestionIndex.
add a getter to the questions.
add a indexed property for the answers objects.
now create a question component which takes the input according to the
currentQuestion parameter.
for example:
<div class="question">
<input jwcid="@FieldLabel" field="component:answer"/>
<input jwcid="@TextField"
displayName="ognl:question.text"
value="ognl:answer.text"/>
</div>
you are done :-)
ציטוט tom:
I've been searching the net for something like this but cannot find any.
Can anyone point me in the right direction to develop dynamic form elements in
tapestry? Tutorials, etc? I need to be able to pull a collection of questions
(and possible answers in the case of select lists) and create questions in a Web
form at runtime that Tapestry can manage.
I've already got all the backend stuff setup in the db. I'm actually porting a
CF application that handles this functionality. This is the final roadblock to
completing the port.
Thanks in advance.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]