Thanks! That works.

Regards,
Wessel van Norel

On Wed, 15 Dec 2004 17:08:48 -0500, Bill Siggelkow
<[EMAIL PROTECTED]> wrote:
> Try something like this:
> 
> <c:forEach var="questionnaire" items="${questionnaires}">
>    <optgroup label="${questionnaire.name}">
>      <c:forEach var="question" items="${questions[questionnaire.id]}">
>        <html:option value="anwe_${question.id}">
>          <c:out value="${question.name}"/>
>        </html:option>
>      </c:forEach>
>    </optgroup>
> </c:forEach>
> 
> -Bill Siggelkow
> 
> Wessel van Norel wrote:
> 
> > Hi all,
> >
> > I was wondering if it is possible to use a HashMap containing vectors
> > as the input for a logic-el:iterate tag.
> >
> > Why do I use a hashmap? That's because I first have to iterate through
> > a list of questionnaires, and per questionnaire I've a list of
> > questions. The hashmap has the questionnaire ID as it's key, and the
> > vector with questions as object. Now I was trying the following to get
> > the vector out of the hashmap (like getting the value of something
> > from a map-backed form):
> >
> > <c:forEach var="questionnaire" items="${questionnaires}">
> >   <optgroup label="${questionnaire.name}">
> >     <logic-el:iterate id="question" 
> > collection="questions(${questionnaire.id})">
> >       <html:option value="anwe_${question.id}"><c:out
> > value="${question.name}" /></html:option>
> >     </logic-el:iterate>
> >   </optgroup>
> > </c:forEach>
> >
> > This doen't work, giving me the following error:
> > Cannot create iterator for this collection
> >
> > The questionnaires Vector and questions HashMap are both in the request 
> > scope.
> >
> > Is what I'm trying to do not possible with logic-el:iterate, or am I
> > missing something?
> >
> > Regards,
> > Wessel van Norel

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to