Also you can set the "sort" value before forwarding to the JSP (ie in
the previous action)
1) Action prepares the SORT collection and sets it in the request
2) Action sets default value to "sort" attribute only if "sort" has no
value (so setting the default)
3) Action forwards to JSP
4) JSP renders html:select and html:options. As sort" as a value (set in
the action) the matching option value will be rendered as SELECTED.

Cheers.
Guillermo.

-----Original Message-----
From: nikhil walvekar [mailto:[EMAIL PROTECTED] 
Sent: Miércoles, 09 de Junio de 2004 06:07 a.m.
To: Struts Users Mailing List
Subject: Re: <html:options .... >


Hi,
 
for html:select tag you can specify value
there you can write your default value from some bean
 
<html:select size="1" name="sort"
onchange="document.forms[4].elements[2].focus()" value="<%=
someBean.getDefault()%>"> <html:options collection="SORT"
property="value" labelProperty="label"/> </html:select>
 
Nikhil.

Caroline Jen <[EMAIL PROTECTED]> wrote:
I try to create a drop down menu as follow:

<html:select size="1" name="sort"
onchange="document.forms[4].elements[2].focus()">
<html:options collection="SORT" property="value" labelProperty="label"/>
</html:select>

I am able to disply the menu.  

I want one of the options to be selected by default. 
Therefore, I want to type SELECTED somewhere.  How do
I do it?


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


 
Nikhil  












Yahoo! India Matrimony: Find your partner online.

NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las 
personas direccionadas en el mail y puede contener informacion (i)de propiedad 
exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier 
opinion en el contenido, es exclusiva de su autor y no representa necesariamente la 
opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion 
esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna 
por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha 
recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo 
inmediatamente junto con todas las copias del mismo, notificando al remitente. No 
debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus 
partes si usted no es el destinatario. Muchas gracias.



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

Reply via email to