• 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

implementing indexed properties for multilevel collection

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

I need to display and submit a form with 3 levels of indexed properties. The
3 indexed properties are not constant in size. I have a form with a
MyObject1[] array with getters and setters for indexed properties. MyObject1
object has a List of MyObject2 objects and MyObject2 has a List of MyObject3
objects.
I would like to display these recursives objects with input fields and
submit them. But I really don't know how to do it for the indexed properties
of level 2 and 3 and how to get the corresponding values. Does someone have
an idea?
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would suggest that you look at the section titled "Dynamic Indexes for Indexed Properties" at this link: http://struts.apache.org/1.x/struts-taglib/indexedprops.html

It shows how to build the indexes using some scriptlet code. I am pretty sure you will have to do it this way instead of using the index attribute. You will need to build up a property value that looks something like:
"MyObject1[0]. MyObject2[0]. MyObject3[0].value"

- Brent
 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can try using Struts Nested Tags.

http://struts.apache.org/1.2.9/userGuide/struts-nested.html

Hope this helps.

Regards,
Arul.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
java freak,

This may seem trivial to you, but the JavaRanch naming policy is an important part of the JavaRanch culture. Please read it and change the "publicly displayed name" in your profile so that it conforms to the policy.

Compliance with this policy is not optional. You've now had two warnings. Your profile could be removed without warning if you fail to comply.
reply
    Bookmark Topic Watch Topic
  • New Topic