You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Hunter Hillegas <li...@lastonepicked.com> on 2003/07/11 20:59:04 UTC

Best Way to Combine Validated Input and Pre-Population?

I have an ActionForm that contains a Collection of JavaBeans. The ActionForm
validates some properties in the JavaBeans in its validate() method.

The Collection uses a LazyList.

There is an Action that pre-populates *some* of the form fields from a
database. Other fields are empty and need to be filled in.

If validation fails and I get pushed back to the entry page I now see a page
that contains values from *two* beans from the Collection. One doesn't
contain the pre-populated data but does contain the data entered on the form
prior to validation. The other does contain pre-populated data but doesn't
contain anything input from the last session... I need these to be combined
into one "entry" as they are when they are input.

For instance, if I have one item in the Collection, I will see that item
displayed with only the pre-populated info along with another blank/empty
item that contains the data entered in the first form, pre-validation.

How can I get this going so that when I return from validation some fields
are pre-populated and some are from entry from the previous form. There
isn't any overlap (i.e. use pre-populated if no data, otherwise use form
entry).

Thanks,
Hunter



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