• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Struts Iterator

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using an iterator to display a collection of objects. The data gets displayed correctly but when the user modifies the data that modification is not reflected in the Collection when it reaches the ActionObject. In other words the data gets mapped to the JSP fields correctly but the data does not seem to be getting mapped from the JSP field back to the Collection correctly.

Can someone tell me if I'm using incorrect syntax in my iterate statement? Is there some other problem here?

Thanks,
Matt


JSP


<logic:iterate id="msrf" name="MSReportForm"
property="departments"
type="com.csi.mos.activity.MSReportFormHelper">
<tr>
<td align="left"><font size="1">
<bean:write name="msrf" property="departmentDesc"/></font>
</td>
<td align="center"><html:text name="msrf"
property="performance" size="16"
maxlength="18"/></td>
<td align="center"><html:text name="msrf"
property="churn" size="16"
maxlength="18"/></td>
</tr>
</logic:iterate>



FORMBEAN


public class MSReportForm extends ActionForm
{
private Collection departments = new ArrayList();
........



FORMBEAN HELPER



public class MSReportFormHelper {

private String departmentDesc;
private String performance;
private String churn;
....
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Matt,

I feel that your Jsp is not getting submitted properly.
Just put some alert messages in the onSubmit function
and see whether the form is getting submitted.

I hope this would solve your problem.

Regards
[ November 23, 2004: Message edited by: Sujatha Kumar ]
 
Matt Connors
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The form is definitely getting submitted. In the Form Bean's validate method I had to resort to "manually" moving the data from the HTTP Request object to the Form Bean's attributes. Any other ideas?
 
Doody calls. I would really rather that it didn't. Comfort me wise and sterile tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic