Rajoy,

Please read the archives of this list before posting questions.  This problem
has been addressed many times.

To summarise again, to update in an iteration, the names of the form elements
must have the index included eg. name="parameter[0].value".  Struts will then
use this to make the following call to populate the form bean:
FormBean.getParameter(0).setValue(value).  In order for this to work, you must
have a Parameter getParameter(int index) getter in your form bean, and
appropriate get/setters in your parameter object.  Various previous messages
provide more details, and there is an example I posted at
http://www.mail-archive.com/[email protected]/msg12084.html.

Cheers,

Dave




"Rajoy" <[EMAIL PROTECTED]> on 09/03/2001 07:22:39 PM

Please respond to "Struts Users Mailing List"
      <[EMAIL PROTECTED]>

To:   "Struts Users Mailing List"
      <[EMAIL PROTECTED]>
cc:    (bcc: David Hay/Lex/Lexmark)
Subject:  Re: Newbie: Iterate tag : Object properties  not updated to form bean
      from JSP



Hi again ..
I am quite new to struts  .. hope someone will take time to go through my
query which I am reposting  ( if not I am gonna come back with a more catchy
subject line !! ;-) )

Thankx in advance (again)
Rajoy

HI all
I've encountered a situation as follows

1. I have a 'UserInfoContainer'  form bean which contains a Vector of
individual 'UserInfo' objects.
2. Each UserInfo object is iterated through using the 'iterate' tag in the
JSP.
3. Some 'UserInfo'  data (say 'NickName' ) is displayed in a text box so
that the user can modify it.

Every thing is going fine till now. The trouble is once I submit the form
and retrieve the 'NickName' from each UserInfo object in the
UserInfoContainer object passed to the perform method , it doesn't reflect
the modifications user entered in the text box. Basicaly the data entered by
the user isn't set back to each UserInfo object by the Action servlet.

I've read in the struts docs that the iterate tag copies each object in the
collection ( in my case the userinfo veactor) to a page scope bean
referenced by the value of 'index' attribute. So I guess the values in the
text boxes inside the iterate tag never gets set to the original objects in
the FormBean.

A. Is my understanding correct ?
B. Am I doing somethimng wrong here ?
C. Is there any way to tackle this problem?

I am at present using lots of request.getParameter methods to get the values
edited by the user. But it really does increaase dependency between the JSP
pages and  the action classes. SO I wonder whether that is the correct way
to go even ...

FYI : 'UserInfoContainer' is a session scope formbean.
Thankx in advance
Rajoy

----- Original Message -----
From: "Rajoy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 03, 2001 7:58 PM
Subject: Newbie: Iterate tag : Object properties not updated to form bean
from JSP


HI all
I've encountered a situation as follows

1. I have a 'UserInfoContainer'  form bean which contains a Vector of
individual 'UserInfo' objects.
2. Each UserInfo object is iterated through using the 'iterate' tag in the
JSP.
3. Some 'UserInfo'  data (say 'NickName' ) is displayed in a text box so
that the user can modify it.

Every thing is going fine till now. The trouble is when I retrieve the
'NickName' from each UserInfo object in the UserInfoContainer object passed
to the perform method , it doesn't reflect the modifications user entered in
the text box. Basicaly the data entered by the user isn't set back to each
UserInfo object.

I've read in the struts docs that the iterate tag copies each object in the
collection ( in my case the userinfo veactor) to a page scope bean
referenced by the value of 'index' attribute. So I guess the values in the
text boxes inside the iterate tag never gets set to the original objects in
the FormBean.
A. Is my understanding correct ?
B. Am I doing somethimng wrong here ?
C. Is there any way to tackle this problem?

I am at present using lots of request.getParameter methods to get the values
edited by the user. But it really does increaase dependency between the JSP
pages and  the action classes. SO I wonder whether that is the correct way
to go even ...

FYI : 'UserInfoContainer' is a session scope formbean.
Thankx in advance
Rajoy



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








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

Reply via email to