You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Yann Verlynde <yv...@oxade.com> on 2002/11/25 10:16:19 UTC

Problem with actionForm scope

Hello,

It seems that I lost my attributes of the form. It seems that my form is
reinitialized when the form is redisplayed.
My form is well defined in my struts-config.xml file as to be used in
session scope.
However, I would like to keep these parameter because I would like to fill
the form at different moments.

name.jsp (1)--->Form class -->name.jsp (filled with the (1)
information)-->Form class etc....

Thanks in advance
Yann





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Problem with actionForm scope

Posted by Gemes Tibor <ge...@regens.hu>.
2002. november 25. 10:16 dátummal Yann Verlynde ezt írtad:

> It seems that I lost my attributes of the form. It seems that my form is
> reinitialized when the form is redisplayed.
> My form is well defined in my struts-config.xml file as to be used in
> session scope.
> However, I would like to keep these parameter because I would like to fill
> the form at different moments.

RTFA

I bet your form is a DynaActionForm. The reset() is called on every request 
for these form. 

You've got 2 options: 

- include all the properties in hidden fields,
- override the reset() of the form.

Hth,

Tib



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Problem with actionForm scope

Posted by Andrew Hill <an...@gridnode.com>.
Well, if your form is defined as using session scope it should work - you
will retain the same form object. In this case you may need to take a look
at what your reset() method is doing as this is called on submit each time
before the form values are populated from the request.

If screen A has field A (but not B) while screen B has field B (but not A)
and your reset unconditionally clears the values for both A and B then on
screen A you will lose the value for field B and on screen B you will lose
the value for field A - to handle this issue you need to check which screen
did the submit in your reset() method and only clear the fields for which
you will be getting new values. Incidentally you only need to clear fields
for which the view is rendered using a checkbox, radio button, multiple
select, or textarea(?) (these being the ones that submit no values under
certain circumstances and thus create the need for a reset() method in the
first place.

-----Original Message-----
From: Yann Verlynde [mailto:yverlynde@oxade.com]
Sent: Monday, November 25, 2002 17:16
To: Struts
Subject: Problem with actionForm scope


Hello,

It seems that I lost my attributes of the form. It seems that my form is
reinitialized when the form is redisplayed.
My form is well defined in my struts-config.xml file as to be used in
session scope.
However, I would like to keep these parameter because I would like to fill
the form at different moments.

name.jsp (1)--->Form class -->name.jsp (filled with the (1)
information)-->Form class etc....

Thanks in advance
Yann





--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>