my dog learned polymorphism*
The moose likes Struts and the fly likes Check box and Indexed properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Check box and Indexed properties" Watch "Check box and Indexed properties" New topic

Check box and Indexed properties

Luke Zechariah
Ranch Hand

Joined: Sep 27, 2005
Posts: 117

I am trying to implement an indexed properties page. Just like the link posted below:


I wanted to add checkbox to the code, (let's say like a shopping cart). I want to delete or save only the boxes that are checked. Please see below my code:


Action Form:

OrderItem java bean:


My question is how do I achieve the functionality, what should I code so that when I check the items only those items either needs to be deleted or saved. Please help me with the code.

Luke Zechariah
Ranch Hand

Joined: Sep 27, 2005
Posts: 117

Hey Found the solution:

On the jsp file, add indexed="true" for

so the final jsp looks as below:

And on the add the following code in the method deleteOrderQty

so the file with look as below:

These changes will provide the desired functionality.
I agree. Here's the link:
subject: Check box and Indexed properties
Similar Threads
Dynamic Row creation at client side and populating the form bean
No collection found
html:hidden within logic:iterate
Struts1: Nested/Indexed properties issue
Indexed Properties Example