Hi Patrick,
a DynaValidatorForm has not
an own reset().
the reset() of DynaActionForm is called
but she doesn�t do anything:
public void reset(ActionMapping mapping, HttpServletRequest request) {
; // Default implementation does nothing
}
but you can
set the properties to its default,
is this what you want?
DynaValidatorForm myForm = (DynaValidatorForm) form;
myForm.initialize(actionMapping);
the properties haven�t an
initial are null
e.g. for Integer.
but for String the length().method returns 0.
the other, store in a session mean,
if "edit" you forward back the form-page
and the "new" values are in the formula.
on "create" you can then remove
the formBean
like:
request.getSession.removeAttribute("nameOfMyFormBean");
hope i understand you right...
and best wishes to your thesis.
i will start mine in februar :-)
Matthias
-----Original Message-----
From: Patrick Scheuerer [mailto:[EMAIL PROTECTED]
Sent: Sunday, January 04, 2004 2:32 PM
To: Struts Users List
Subject: Advice needed for ActionForm problem
Hi,
Can somebody tell me the "best practice" for solving the following
problem?
A setup action retrieves some data which is needed to render select
elements
from the database. This action puts the retrieved collections into the
request
and forwards to the jsp form.
On submit, a preview action is called. this action retrieves the data
from the
form and puts it into a value object. some more data is retrieved from
the
database to complete the data in the value object. the forward sends the
user to
the preview jsp where all the collected information is presented for
review.
there are two submit buttons on the page: one to create the new data
record and
one to make changes to it. the called action checks which button has
been
pressed. If it's the create button the data is saved, if it's the edit
button
the user is sent back to the input form.
What is the best way to use an ActionForm across multiple pages? is it a
good
idea to store the form in session scope (that's what I'm doing now) ?
Can I
manually call reset on a DynaValidatorForm?
The second question: if the edit button is pressed i have to reload the
collections needed to display the form again. Is there no better
alternative. I
've been thinking about putting collections that are needed in several
places
into session scope.
I would be really interested in how the pros solve this problem (I'm
just a
student working on my thesis project). Any comments, suggestions and
tips are
welcome.
Thank you,
Patrick
---------------------------------------------------------------------
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]