velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Jacobson <marti...@libero.it>
Subject Re: multiple select list
Date Fri, 28 Mar 2003 10:47:28 GMT
Luke Majewski wrote:
> I'm having some trouble getting started using a multiple select list widget of the form
> 
>     <select multiple size=6 name=resourceLanguageId[]>         #foreach ($lang
in $languages) 
>             <option value="$lang.id"  
>             #if ($lang.flag) selected #end
>         >$lang.name
>         #end
> 
>     </select>
> 
> I am stuck trying to figure out where to go from here, displaying the items is fine,
but I'm not sure how to pass the information about which items are selected to my java code.
 Can anyone point me the right direction?
> 
> Thank you,
> 
> Luke Majewski
> Center for Promotion of Child Development Through Primary Care

Not a velocity question, but assuming you are POSTing to a servlet, then 
you have an HttpServletRequest - lets call it req.

do the following:

     String[] langIds = req.getParameterValues("resourceLanguageId[]");

the selected ids are in the array. Easy!

HTH,

Martin


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


Mime
View raw message