You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tom Watkins <to...@shazamteam.com> on 2001/12/19 10:02:13 UTC

strutshtml select tag initial value

I have a jsp using the <strutshtml:select> tag with nested <option> tags. I
need to give the drop down list an initial value first time it is seen which
I have done using <option selected value="blah">...

However, when page validation fails I need the list to display the user
selected value but obviously it reverts to the <option> tag which I labelled
"selected".

I can see no obvious way of doing this (although I am sure there is one)

Can anyone help?

Tom


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: strutshtml select tag initial value

Posted by Tom Watkins <to...@shazamteam.com>.
brilliant - thanks

-----Original Message-----
From: Keith Bacon [mailto:keithbaconstruts@yahoo.com]
Sent: 19 December 2001 12:02
To: Struts Users Mailing List
Subject: Re: strutshtml select tag initial value


If you use the struts option tag it will get the
selected value from the formbean when the page is
displayed (reverse of the way it sets the selected
value when the form is submitted).
Then you have full control!
Keith.


--- Tom Watkins <to...@shazamteam.com> wrote:
> I have a jsp using the <strutshtml:select> tag with
> nested <option> tags. I
> need to give the drop down list an initial value
> first time it is seen which
> I have done using <option selected value="blah">...
>
> However, when page validation fails I need the list
> to display the user
> selected value but obviously it reverts to the
> <option> tag which I labelled
> "selected".
>
> I can see no obvious way of doing this (although I
> am sure there is one)
>
> Can anyone help?
>
> Tom
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: strutshtml select tag initial value

Posted by Keith Bacon <ke...@yahoo.com>.
If you use the struts option tag it will get the
selected value from the formbean when the page is
displayed (reverse of the way it sets the selected
value when the form is submitted).
Then you have full control!
Keith. 


--- Tom Watkins <to...@shazamteam.com> wrote:
> I have a jsp using the <strutshtml:select> tag with
> nested <option> tags. I
> need to give the drop down list an initial value
> first time it is seen which
> I have done using <option selected value="blah">...
> 
> However, when page validation fails I need the list
> to display the user
> selected value but obviously it reverts to the
> <option> tag which I labelled
> "selected".
> 
> I can see no obvious way of doing this (although I
> am sure there is one)
> 
> Can anyone help?
> 
> Tom
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>