• 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Frits Walraven
  • Himai Minh

Capturing a list of details from the UI to ActionForm

Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On my UI, I am displaying a list of objects:

  • Employee id: 1
    Employee Name: xyz
    Age : 28
    Phone: 235325

  • Employee id: 2
    Employee Name: abc
    Age : 30

  • Employee id: 3
    Employee Name: pqr
    Age : 25
    Phone: 363433

  • The above fields are editable (except employee id) and have been loaded dynamically on basis of a search mechnism (to load employees with specific properties.) Since they have been loaded dynamically, the names of all fields are the same on the UI. They look like this.

    Similarly for phone. But phone may or may not exist on the UI depending on whether an employee has a phone or not.

    The entire form has one submit button, mapped to an updateAction to update the new details put in by the user.

    My Action form contains a String[] array txtname, String[] array txtage and and String[] array txtphone. When the details on the UI are captured in the above properties, in order to decipher which employee name, age or phone corresponds to which employee id, I have appended the employee id to the values of the textboxes.

    BUT I think there must be a way in which i could capture these details in a better manner (in objects). So, in the my ActionForm i could have a list of Employee objects, each of which would contain the details submitted from the UI. But i am not able to figure out how to go about this.

    First of all, can my ActionForm contain an Employee List which could be populated automatically with details from the UI??

    I am simply looking for a better way to do this. Please advise.

    Why does your bag say "bombs"? The reason I ask is that my bag says "tiny ads" and it has stuff like this:
    the value of filler advertising in 2021
      Bookmark Topic Watch Topic
    • New Topic