Jump to content
xisto Community
Sign in to follow this  
kvarnerexpress

Html:multibox

Recommended Posts

I have a JSP where data is shown by use of a for:each loop. In this loop I have a multibox tag which will display checkboxes next to each corresponding row. A user will have the ability to select all or a few or none of the checkboxes and click print. From here, the action gets called where I need to find out which rows were clicked. Right now if I click 3 checkboxes then the String[] in the form is created with array[0] = "checked", array[1] = "checked", array[2] = "checked". This does not help because I need to know which columns were not checked. How can I do this?Kvarnerexpress

Share this post


Link to post
Share on other sites

Now, since you have for:each loop, you know for how many times the loop has run.Example: if loop runs for 10 times, you have array[0] ....to array[9]. If user checks array[2] and array[5] then you know that this two checkboxs has been checked.So you just sustract those 2 and 5 from list of 0 to 9 and what ever left is your answer.You can also give each checkbox name like checkbox0 to checkbox9. Also, if you want to pass the total value of loop in form, then print that for:each total loop value as hidden field, so later you can access it in action.Hope this will help and solve your problem.Thank You. :D:(:D:(:(

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.