On 12/22/05, Vikrama Sanjeeva <[EMAIL PROTECTED]> wrote:
> Actually I'm using a javascript which needs to define form name. And in
> struts, when you define form name it is mandatory to define type too.
>
>    I just change the "scope" in struts-config from "request" to "session"
> and it is working fine now. But question is, why it is not working with
> scope=request?
>
<snip/>

What is the pre-population mechanism that you mention below? Is it
request-sensitive for the controls that don't get pre-populated?

-Rahul


> Bye,
> Viki.
>
> On 12/22/05, Laurie Harper <[EMAIL PROTECTED]> wrote:
> >
> > You shouldn't need either name or type, Struts will derive both from the
> > configuration. Since you say that's working OK for you, why are you
> > trying to add them?
> >
> > L.
> >
> > Vikrama Sanjeeva wrote:
> > > Hi,
> > >
> > >  I have a form which consists of pull-down menus, radio button, text
> > area
> > > and text fields. The form takes all the required input fields from user,
> > > validate them and if validation fail's, the same form is called with
> > > pre-populated values (as entered 1st time by user). This is true when
> > there
> > > is NO form "name" and "type" is given in form tag. But when I give form
> > > "name" and "type" in form tag, only pull-down menus are populated if
> > > validation fails. Whereas, text field, text area and radio buttons are
> > not
> > > pre-poulated.
> > >
> > >   I'm not sure what is going wrong here?? Below is the related code I'm
> > > using.
> > >
> > > /******** struts-config.xml*******/
> > >
> > > <form-bean name="myForm" type="com.world.MyForm"/>
> > >
> > > <action path="/MyActionPath"
> > >             type="com.world.MyActionClass"
> > >             name="myForm"
> > >             scope="request"
> > >             validate="true"
> > >             input="myForm.jsp"
> > >             >
> > >             <forward
> > >                     name="success"
> > >                     path="/myHome.jsp"/>
> > >  </action>
> > >
> > > /******** struts-config.xml*******/
> > >
> > > /********START myForm.jsp*******/
> > >
> > > <!-- When given form "name" and "type", it fails to populate the text
> > field,
> > > radio-button and text-area after validation falis. -->
> > >
> > > <html:form   name="myForm" type="com.world.MyForm
> > "  action="/MyActionPath"
> > > method="post" enctype="multipart/form-data">
> > >
> > >         <html:radio property="happy"  value="Y">Happy</html:radio>
> > >
> > >         <html:select name="myForm" property="country">
> > >             <html:option value="">Select Country</html:option>
> > >              <html:options collection="countryNames"
> > property="countryName"
> > > labelProperty="countryName" />
> > >         </html:select>
> > >
> > >         <html:text property="name"></html:text>
> > >
> > >        <html:textarea property="details"></html:textarea>
> > >
> > > </html:form>
> > > /******** END myForm.jsp*******/
> > >
> > >
> > > Bye,
> > > Viki.
> > >
<snap/>

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

Reply via email to