You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by shashikant nagthan <na...@lycos.com> on 2003/04/17 17:14:33 UTC

need help, to populate a jsp from the ActionForm

Hi
I am trying  to populate a jsp using the actionform after clicking on "submit". it somehow doesn't work for indexed fields but works fine for other fields in the jsp. 

the jsp code is as below -

<html:text name="nameForm" property="name"/>
<% for ( int i =0; i < size; ++ i) {
<td>
<html:text name="nameForm" property='<%= "udev[" + i + "].col1"%>'/>
</td>
<td>
<html:text name="nameForm" property='<%= "udev[" + i + "].col2"%>'/>
</td>
<% } %>


and i am setting the values in the "reset()" method of the actionform. the  code is something like this -

public void reset(ActionMapping mapping, HttpServletRequest request) {

   servlet.log("in action form reset" );
   this.name = request.getParameter("name");

   this.udev = new ArrayList();   
   for (int j=0 ; j< size; ++j) {
      Myclass ud= new Myclass();
      ud.setcol1(request.getParameter("udev[" + j + "].col1") ;
      ud.setcol2(request.getParameter("udev[" + j + "].col2") ;
      this.udev.add(ud) ; 
   }
}

again, this works fine for the text field with property="name", but not for the indexed fields.
has anyone come across such a situation and been able to solve it??

thanks ,
Shashi.


____________________________________________________________
Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005

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


Re: need help, to populate a jsp from the ActionForm

Posted by ha...@informatiefabriek.nl.
I think you should use the <logic:iterate> tag.

Cheers, Harm.




"shashikant nagthan" <na...@lycos.com> 
04/17/2003 05:14 PM
Please respond to
"Struts Users Mailing List" <st...@jakarta.apache.org>


To
struts-user@jakarta.apache.org
cc

Subject
need help, to populate a jsp from the ActionForm






Hi
I am trying  to populate a jsp using the actionform after clicking on 
"submit". it somehow doesn't work for indexed fields but works fine for 
other fields in the jsp. 

the jsp code is as below -

<html:text name="nameForm" property="name"/>
<% for ( int i =0; i < size; ++ i) {
<td>
<html:text name="nameForm" property='<%= "udev[" + i + "].col1"%>'/>
</td>
<td>
<html:text name="nameForm" property='<%= "udev[" + i + "].col2"%>'/>
</td>
<% } %>


and i am setting the values in the "reset()" method of the actionform. the 
 code is something like this -

public void reset(ActionMapping mapping, HttpServletRequest request) {

   servlet.log("in action form reset" );
   this.name = request.getParameter("name");

   this.udev = new ArrayList(); 
   for (int j=0 ; j< size; ++j) {
      Myclass ud= new Myclass();
      ud.setcol1(request.getParameter("udev[" + j + "].col1") ;
      ud.setcol2(request.getParameter("udev[" + j + "].col2") ;
      this.udev.add(ud) ; 
   }
}

again, this works fine for the text field with property="name", but not 
for the indexed fields.
has anyone come across such a situation and been able to solve it??

thanks ,
Shashi.


____________________________________________________________
Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005

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




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