You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Muhammad Momin Rashid <mo...@amaana.com> on 2004/07/24 15:12:36 UTC

Two collections and iterate: How to set corresponding values in second collection while iterating through first?

Hi,

I have two collections of objects one contains the questions, and the second
is place holder for answers the user is supposed to provide.

questions is a collection of question (= id, text, type)
answers is a collection of answer (= id, questionId, answer)

now in my jsp i would like to do something like this

<logic:iterate id="ques" name="questions" indexId="i">
    <bean:write name="ques" property="text"/>

    ?? for the corresponding answer in the answers collection
    ?? set the questionId
    ?? display a text box for user to enter answer text

</logic:iterate>

Regards,
Muhammad Momin Rashid





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org