struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Edgar" <robed...@hkstar.com>
Subject RE: Multi Page Form
Date Fri, 07 Jul 2000 00:24:48 GMT
Yea,
I have just used the "action" field from the registration example for this
purpose, it now holds the values "Step1" ,"Step2", Step3" and then at the
bottom of the action bean I have a "forward" statement based on which Step I
currently am on. In the first version I have turned off all validations so I
can just test the multipage part first... works fine ....


now on to the validation issue

Did you make the hidden field a property of the form bean? I guess this way
makes the most sense, so you can still auto validate..

Rob

-----Original Message-----
From: jbirchfield@ironmax.com [mailto:jbirchfield@ironmax.com]
Sent: Friday, July 07, 2000 1:58 AM
To: struts-user@jakarta.apache.org
Cc: struts-user@jakarta.apache.org
Subject: RE: Multi Page Form



The idea of a step has gotten us through this sticking point.  In each
form, we assign one hidden field, the current step of that particular form.
In the validate method, we have a case statement that validates only the
fields that are involved with that step.  Works great for us this way.

James Birchfield
Senior Software Engineer

Ironmax.com LLC
a better way to buy, sell and rent construction equipment
5 Corporate Center
9960 Corporate Campus Drive,
Suite 2000
Louisville, KY 40223


|--------+----------------------->
|        |          "David       |
|        |          Chisholm"    |
|        |          <David_Chisho|
|        |          lm@i2.com>   |
|        |                       |
|        |          07/06/00     |
|        |          01:43 PM     |
|        |          Please       |
|        |          respond to   |
|        |          struts-user  |
|        |                       |
|--------+----------------------->

>---------------------------------------------------------------------------
----------------------------------------------------------|
  |
|
  |       To:     <struts-user@jakarta.apache.org>
|
  |       cc:
|
  |       Subject:     RE: Multi Page Form
|

>---------------------------------------------------------------------------
----------------------------------------------------------|





> -----Original Message-----
> From: Craig R. McClanahan [mailto:Craig.McClanahan@eng.sun.com]
> Sent: Thursday, July 06, 2000 11:34 AM
> To: struts-user@jakarta.apache.org
> Subject: Re: Multi Page Form
>
>
> The following strategies seem like they might work for multi-page
> ("wizard"
> like) forms:
>
> * Do not validate each individual form; validate only at the end.
>   (Not very good user interface technique, however).
>
> * Keep all the input in a single ValidatingActionForm, and
>   include a hidden field on each page so that the form's
>   validate() method knows which fields should be checked.
>   This requires the form bean to know what fields are on
>   what pages.  (The name of the hidden field would be the
>   same on all pages, and would be a property of the form
>   bean so that it gets set on every request.)
>

How about assigning the hidden field the names of all of the fields that
are
to be validated for the current form; creating an isValidXXX() method for
each property of the bean (where XXX is the property name); and then using
reflection to validate each property specified in the hidden field?  The
ValidatingActionForm bean would not need to know the names of all of the
fields on each page with this approach, but the disadvantage of course is
the overhead of the additional introspection.
David




> * Use separate form beans for each page (perhaps saved
>   in the session), each of which validates its own input,
>   and combine the results on the final submit.
>
> My personal preference would be for the second approach.
>
> Craig McClanahan
>
>
>
> Quaini Michele wrote:
>
> > (Hello to everyone on the list)
> >
> > Are you speaking about a wizard-like approach?
> >
> > This is exactly what we have to do for the next phase of
> > our project. I also think the validation should be done
> > after the user press the 'Next' button, an he user is not
> > allowed to process further.
> >
> > Is there someone that has already made some like this with struts?
> > I need help too in this matter.
> >
> > Michele
> >
> > -----Original Message-----
> > From: Robert Edgar [mailto:robedgar@hkstar.com]
> > Sent: mercoledì 5 luglio 2000 18.54
> > To: struts-user@jakarta.apache.org
> > Subject: Multi Page Form
> >
> > Can some give me an idea on how multipage forms are supposed to work.
> >
> > i.e. in the stuts registration example its a single page form
> that gets auto
> > validated, but how do you handle this in multi page forms when
> you wont yet
> > have completed parts of the form that maybe required but are on
> a differnet
> > page. I cant see how to handle this other than just manually
> validate each
> > page of the form by itself.
> >
> > Rob
>






Mime
View raw message