• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

<logic:iterate> Update issue

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am trying to update the value of age over here. While doing the form submit, the form bean in the action class is not updated and having the old value. Could you please suggest to implement this?
 
Ranch Hand
Posts: 213
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the other values are being updated and the age field is not then I would check and see if the setter for the field is being hit when the form is submitted.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'd need to use indexed properties or *something* like that since you're inside an iterator. Without seeing the rest of the form it's impossible to help more, though.
 
Siva Arun
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Form Bean(StudentManagementFormBean) is having a single field 'studentList' which is a type of ArrayList<com.siva.bean.pojo.Student>. The same list is coming from the model part of a application. I just need to return the same list with the updated age.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:You'd need to use indexed properties or *something* like that since you're inside an iterator. Without seeing the rest of the form it's impossible to help more, though.


No, really. Either that or create a new form that has just the values you want, merge into the underlying data in the action.
 
Richard Golebiowski
Ranch Hand
Posts: 213
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oops! I completely spaced on the part about this being in an iterate tag. What David said is correct. You need to think about how Struts is going to be able to set the returned value. I find in these types of situations that it helps if you look at the HTML that is generated.
 
reply
    Bookmark Topic Watch Topic
  • New Topic