struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "leonZ" <leons...@netease.com>
Subject Re: How can I set the defualt selection?
Date Tue, 08 Jul 2003 03:11:00 GMT
But how do you set the defualt option without submit the form?
action.execute() need the HttpServletRequest object, and this object is got
from a submitting of a form in jsp.
Maybe I am wrong, could give me a valid code segment example?

"Adam Hardy" <ahardy.struts@cyberspaceroad.com> wrote in message
news:3F09452A.6010301@cyberspaceroad.com...
> Struts will automatically mark the selected option when the value of the
> select box field/property in the actionform is set.
>
> So if you want to set one option as default in a blank form, set the
> actionform property to the value of the option you want. Preferably in
> the action.execute() so you don't muddle your jsp unnecessarily.
>
> Adam
>
> Caroline Jen wrote:
> > I have similar questions.  What is the syntax of the
> > <html:option> tag?
> >
> > Just take the example given by you, are the codes
> > shown below correct?  Will the default selection
> > shown?
> >
> > <html:select property="select1">
> >      <html:option property="1" labelProperty="first">
> >      <html:option property="2" labelProperty="second">
> >      <html:option property="3" labelProperty="third">
> > </html:select>
> >
> > JPJ
> >
> > --- leonZ <leonshow@netease.com> wrote:
> >
> >>I make it more clear here:
> >>
> >>A normal html:
> >><select name="select1">
> >>          <option value="1">first</option>
> >>          <option value="2" SELECTED>second</option>
> >>          <option value="3">third</option>
> >></select>
> >>
> >>how can I use the 'SELECTED' to set a defualt option
> >>with struts tags.
> >><html:select property="select1">
> >>        <html:option>
> >>        ...
> >></html:select>
> >>
> >>"leon" <leonshow@netease.com> wrote in message
> >>news:be59qa$krs$1@main.gmane.org...
> >>
> >>>I am a beginner of struts. I can't use the
> >>
> >>'selected' property of the
> >>select
> >>
> >>>tag in struts to set the default selection like I
> >>
> >>used it in a normal
> >>html.
> >>
> >>>It's happened in 'checked' property of struts
> >>
> >>radio tag. Could you tell me
> >>
> >>>how to set a defualt selection.
> >>
> >>
> >>
> >>
> >>
> > ---------------------------------------------------------------------
> >
> >>To unsubscribe, e-mail:
> >>struts-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail:
> >>struts-user-help@jakarta.apache.org
> >>
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > SBC Yahoo! DSL - Now only $29.95 per month!
> > http://sbc.yahoo.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >




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


Mime
View raw message