Well, when I said: "these values are the same that the user introduced" I
would want to say: "the values selected by the user in the listbox" .And the
values introduced in fields, checkbox, ... stay too
When an error occur, it doesnt return to preprare action. It just back to
the page selected in the tag "input" (input="/prepare.jsp" )
You dont need to write code like this...

if (!comingFromAValidationError())
form.fillfromDB();
else
// leave form as is, with data entered by the user
}

When an error occurs it just redirects the request with the values
introduced by the user to the page "prepare.jsp".
Please, try it. It's very easy and simple. If you have any problem or you
dont understand anything IŽll help you
Alvaro

----- Original Message ----- 
From: "Leonardo Francalanci" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, February 06, 2004 9:03 AM
Subject: R: repost: validator & retrieving data


I'm sorry, I'll try to explain better.

>
> >If I used your solution in case of a validation error my list box
> >would not be filled.
>
> When you have a validation error it returns to the page where you
> filled the
> list box and these values are the same that the user introduced.

The listbox and the data the user entered are 2 different things.
The listbox is a list of values the user can only choose, not change.
The data the user modified is on a form that is filled with values
from the db by the "prepare" action.

Here is a pseudo-code:

prepareaction.execute(Form form) {

mylistbox.fillfromDB();
form.fillfromDB();
}


I'd like something like:

prepareaction.execute(Form form) {


mylistbox.fillfromDB(); // as before
if (!comingFromAValidationError())
form.fillfromDB();
else
// leave form as is, with data entered by the user
}

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


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

Reply via email to