In case anyone is interested.  I solve the problem by extending
org.apache.struts.validator.DynaValidatorForm and overriding the method
public void reset(org.apache.struts.action.ActionMapping mapping,
                  javax.servlet.http.HttpServletRequest request){};

-- Derek

----- Original Message -----
From: "James Mitchell" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, October 28, 2002 10:52 PM
Subject: RE: Problem with multiple html(jsp) pages sharing one form
(actionform)


> No, not in the scenario I described earlier.
>
>
>
> James Mitchell
> Software Engineer/Struts Evangelist
> http://www.open-tools.org
>
> "Only two things are infinite, the universe and human stupidity, and I'm
not
> sure about the former."
> - Albert Einstein (1879-1955)
>
>
> > -----Original Message-----
> > From: Derek Lin [mailto:dereklin@;hotmail.com]
> > Sent: Tuesday, October 29, 2002 1:22 AM
> > To: Struts Users Mailing List
> > Subject: Re: Problem with multiple html(jsp) pages sharing one form
> > (actionform)
> >
> >
> > James,
> >
> > Are you using the plugin validator to validate your form fields?
> >
> > I am using it.  (see my form entry in my validation.xml at the
> > end).  Now If
> > I only include a subset of form in one page, the validator will throw
> > exceptions in the backgroud.  Are you aware of this?  Any workaround
other
> > than modifying the validator's source?
> >
> > Thanks,
> >
> > Derek
> >
> >         <form name="RegistrationForm">
> >           <field property="firstName"
depends="futurecargorequired"><arg0
> > key="firstName"/></field>
> >           <field property="lastName" depends="futurecargorequired"><arg0
> > key="lastName"/></field>
> >          <field property="companyName"
depends="futurecargorequired"><arg0
> > key="company"/></field>
> >          <field property="companyStreet"
> > depends="futurecargorequired"><arg0
> > key="street"/></field>
> >          <field property="companyCity"
depends="futurecargorequired"><arg0
> > key="city"/></field>
> >          <field property="companyState"
> > depends="futurecargorequired"><arg0
> > key="state"/></field>
> >          <field property="companyZip"
depends="futurecargorequired,mask">
> >             <arg0 key="zip"/>
> >
> > <var><var-name>mask</var-name><var-value>${zip}</var-value></var>
> >           </field>
> >          <field property="companyCountry"
> > depends="futurecargorequired"><arg0 key="country"/></field>
> >          <field property="companyPhone"
> > depends="futurecargorequired,mask">
> >             <arg0 key="phone"/>
> >
> > <var><var-name>mask</var-name><var-value>${phone}</var-value></var>
> >           </field>
> >          <field property="companyEmail"
> > depends="futurecargorequired,email"><arg0 key="email"/></field>
> >           <field property="companyUsername"
> > depends="futurecargorequired,minlength">
> >             <arg0 key="username"/>
> >             <arg1 name="minlength" key="${var:minlength}"
> > resource="false"/>
> >
> > <var><var-name>minlength</var-name><var-value>3</var-value></var>
> >           </field>
> >          <field property="companyPassword"
> > depends="futurecargorequired,minlength,mask">
> >             <arg0 key="password"/>
> >       <arg1 name="minlength" key="${var:minlength}" resource="false"/>
> >
> > <var><var-name>mask</var-name><var-value>^[0-9a-zA-Z][0-9a-zA-Z][0
> > -9a-zA-Z][
> > 0-9a-zA-Z]*$</var-value></var>
> >       <var><var-name>minlength</var-name><var-value>5</var-value></var>
> >          </field>
> >           <field property="companyPassword2"
> > depends="futurecargorequired,twofields">
> >                     <arg0 key="password2"/>
> >                     <arg1 key="password"/>
> >
> > <var><var-name>secondProperty</var-name><var-value>companyPassword
> > </var-valu
> > e></var>
> >           </field>
> >         </form>
> >
> > ----- Original Message -----
> > From: "James Mitchell" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Monday, October 28, 2002 1:36 PM
> > Subject: RE: Problem with multiple html(jsp) pages sharing one form
> > (actionform)
> >
> >
> > > Hi Derek,
> > >
> > > Sorry for not getting back sooner.
> > >
> > >
> > > > if you are using the same action and jsp for your wizards, how
> > > > are they qualified to be wizards?
> > >
> > > Whenever I need a wizard-like flow in my application, I use a single
> > action
> > > and a single jsp to go from Step 1 to Step n.
> > >
> > > I can do this by passing around a token called "step", which is
> > a field on
> > > my form used only for the purpose of this wizard.
> > >
> > >
> > > Here's a bit of psuedo code...
> > >
> > > wizard.jsp
> > > ----------
> > > <taglib declarations>
> > >
> > > <html:form ....blah blah
> > > <!-- Stuff you want on every page -->
> > >
> > >
> > > <!-- Step 1 -->
> > >  <logic:equal name="wizardForm"
> > >               property="step"
> > >               value="1">
> > >
> > >           Field 1:<html:text property="field1"/><br>
> > >           Field 2:<html:text property="field2"/><br>
> > >           Field 3:<html:text property="field3"/><br>
> > >           Field 4:<html:text property="field4"/><br>
> > >           Field 5:<html:text property="field5"/><br>
> > >
> > >  </logic:equal>
> > >
> > > <!-- Step 2 -->
> > >  <logic:equal name="wizardForm"
> > >               property="step"
> > >               value="2">
> > >
> > >           Field 6:<html:text property="field6"/><br>
> > >           Field 7:<html:text property="field7"/><br>
> > >           Field 8:<html:text property="field8"/><br>
> > >           Field 9:<html:text property="field9"/><br>
> > >           Field 10:<html:text property="field10"/><br>
> > >
> > >  </logic:equal>
> > >
> > > <!-- Step 3 -->
> > >  <logic:equal name="wizardForm"
> > >               property="step"
> > >               value="3">
> > >
> > >           Field 11:<html:text property="field11"/><br>
> > >           Field 12:<html:text property="field12"/><br>
> > >           Field 13:<html:text property="field13"/><br>
> > >           Field 14:<html:text property="field14"/><br>
> > >           Field 15:<html:text property="field15"/><br>
> > >
> > >  </logic:equal>
> > >
> > > </html:form>
> > >
> > >
> > > So I handle the form submit and validation within my Action class
(This
> > give
> > > me the most control).
> > >
> > > By doing it this way, if I need to move field 6 thru 8 to Step 1, I
can
> > drag
> > > it up
> > > there within my text editor. (as opposed to cutting it from one jsp
and
> > > pasting into another)
> > >
> > > Not to mention repeating the page headers footer and any other page
data
> > > (style, javascript, etc)
> > >
> > >
> > > James Mitchell
> > > Software Engineer/Struts Evangelist
> > > http://www.open-tools.org
> > >
> > > "Only two things are infinite, the universe and human stupidity, and
I'm
> > not
> > > sure about the former."
> > > - Albert Einstein (1879-1955)
> > >
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Derek Lin [mailto:dereklin@;hotmail.com]
> > > > Sent: Monday, October 28, 2002 2:01 AM
> > > > To: Struts Users Mailing List
> > > > Subject: Re: Problem with multiple html(jsp) pages sharing one form
> > > > (actionform)
> > > >
> > > >
> > > > James,
> > > > First of all, if you are using the same action and jsp for your
> > > > wizards, how
> > > > are they qualified to be wizards?  Perhaps I am not getting what you
> > mean.
> > > > But a wizard would mean many different jsp's to me.  But anyway,
> > > > that is not
> > > > very important at this point.
> > > >
> > > > I tried what you have suggested.  All the data is gone.
> > > >
> > > > On top of that, I have did some debugging.
> > > >
> > > > This is what I get from the my RegistrationForm after I hit
> > > > submit in step1:
> > > > (As you can see the properties are set nicely)
> > > > DynaActionForm[dynaClass=RegistrationForm,userPhoneType=,companyPa
> > > > ssword2=,c
> > > > ompanyEmailType=primary,companyPassword=,companyUsername=,creditca
> > > > rdNumber=,
> > > > companyPhone=1234567890,userEmailType=,companyName=u,companyZip=94
> > > > 112,credit
> > > > cardType=,userPhone=,creditcardExpDate=,userRole=admin,companyFax=
> > > > u,companyS
> > > > treet=u,[EMAIL PROTECTED],firstName=,companyCountry=US,company
> > > > State=u,us
> > > > erFax=,companyStreet2=u,userEmail=,companyAddressType=primary,comp
> > > > anyProvinc
> > > > e=,companyPhoneType=primary,companyCity=u,lastName=]
> > > >
> > > > Now, when I hit submit on step2, here is what I get: (The previous
> > values
> > > > are gone.  Only new values are there.  The reset method had to be
> > > > called or
> > > > a new instance of RegistrationForm was generated.)
> > > > DynaActionForm[dynaClass=RegistrationForm,userPhoneType=,companyPa
> > > > ssword2=12
> > > > 3456,companyEmailType=primary,companyPassword=123456,companyUserna
> > > > me=uyy,cre
> > > > ditcardNumber=,companyPhone=,userEmailType=,companyName=,companyZi
> > > > p=,creditc
> > > > ardType=,userPhone=u,creditcardExpDate=,userRole=admin,companyFax=
> > > > ,companySt
> > > > reet=,companyEmail=,firstName=u,companyCountry=,companyState=,user
> > > > Fax=u,comp
> > > > anyStreet2=,userEmail=u,companyAddressType=primary,companyProvince
> > > > =,companyP
> > > > honeType=primary,companyCity=,lastName=u]
> > > >
> > > > One more thing is that, not sure if this is relevant, I am also
using
> > the
> > > > struts validator to validate for form.  And while I fix the
JavaScript
> > to
> > > > only validate the "existing" formfileds, the struts validator
> > (java) is
> > > > throwing exceptions on my console (since the form values don't
> > > > "exist" -- I
> > > > only use a portion of the form here -- you get the picture, right?)
> > These
> > > > exceptions do cause the application to stop.  My app goes on with no
> > > > apparent problems.  (At some point, I want to modify the
> > > > validator to detect
> > > > "existing" formfields only.  Or is anyone working on that?)
> > > >
> > > > To sum this up.  I think either the reset method is called or a
> > > > new instance
> > > > of my form is created.
> > > >
> > > > Do you have a example of a wizard working?--one that expands to
> > > > two or more
> > > > jsp's.  If so, can you just copy and paste the code here.  I want
> > > > to know if
> > > > anyone has indeed got it to work.  (seems to be a very common
> > > > feature to me
> > > > since it has be mentioned in many places)
> > > >
> > > > -- Derek
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:struts-user-unsubscribe@;jakarta.apache.org>
> > > For additional commands, e-mail:
> > <mailto:struts-user-help@;jakarta.apache.org>
> > >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@;jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>
>

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

Reply via email to