On Saturday, January 19, 2002, at 09:58 AM, Mahesh Agarwal wrote:

> Hi all
>
>
>  In a List box if particular option has to be selected(say the 3rd one 
> in a
> list of 5). Normally "selected" word has to be placed inside the 
> relevant
> option tag "<option .... selected>"  . In struts the very first option 
> shows
> as the selected one on the browser. But if you need to show the 3rd 
> option
> as slelected in the list how do we do that in struts?
>
> thanks a lot in advance
> Mahesh
>

If you use the struts-html tags, and use a form bean which is setup with 
the correct defaults, struts does this automagically. So for example, 
say the drop-down list is a choice between "a", "b" and "c", and the 
property is called 'choice', and you want "c" to be the default, then 
you just make sure that the default value of choice in your form bean is 
"c".

If you need me to clarify further, email me and I'll send you some code 
to show what I mean.

Yours,

Peter


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

Reply via email to