Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom objects on the ActionForm

 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I have a Action form on which I have Custom objects like objOrders.
This also contains a composite object say OrderLine.

When on form, everywhere Im using it like property="Order.OrderLine".
To be available on the next page, I also have hidden fields on the page
<htnl:hidden property="Order.OrderId"/> which makes a html hidden field like
<input name="Order.OrderId" value="12345"/> - which becomes a very odd name and not useful

<htnl:hidden name="Order" property="OrderId"/> gives out <input name="OrderId" value="12345"/>
this is also not useful as actually I need something which suggests that the OrderId is a field in Order and lets me maintain it on the page as a hidden field.

Worse, the set and get of Order.OrderLine.OrderLineId becomes difficult.

Can anyone help me on this? Im basically trying to get the values of these from the jsp to the form/action.

Regards,
Leena
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Leena Diwan:

<input name="Order.OrderId" value="12345"/> - which becomes a very odd name and not useful


Why is this not useful? This is how Struts works through dotted notation.
 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
coz this becomes the name and does not populate the value in the OrderId property in the Order object on the form.

Pls correct me if Im wrong.

Regards,
Leena
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe the follwing link might answer some of your questions about nested properties, etc.

http://struts.apache.org/faqs/indexedprops.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic