Struts2: How to set corresponding values of selected row in the VO class from JSP report?

You could update the submit() method to get the correct values and pass them to the action.

1 This is the technique I've used in the past. Have some hidden fields that have no value, and write to them in your onclick handler, before calling submit(). – Brian Yarger Aug 17 '09 at 19:59 Dear Nate and Brain, rather than calling submit() method directly onclick event of checkbox I tried this by calling a function say abc() of javascript and see below my abc() function - friends but no gain.

Same problem, I mean if hiddens are written in iterator tag then returning values of all rows separated by commas and if hiddens are written outside iterator tag then returning null. Help. – vivmal Aug 18 '09 at 3:55.

In your javascript function, you would set the current values then submit. So you'd have something like this: ID PROOF DELETE.

Brain, thanks for your reply. I tried your solution, its getting the selected value in the function submitform(requestId, requestChecker, requestProof) but sending NULL in my action class. I made a change like I wrote the hidden fileds in tag and this time it is sending the valus of all properties who's object is iterating in tag.

Brain, you know just 2 months back I had done this. It was running smooth without any javascript. But by mistake code has lost.So, I sure this feature is available in struts2 and its very simple but currently not coming in mind.

Try n thx a lot. – vivmal Aug 19 '09 at 3:28.

It depends on what you are doing. If you can recreate the List on the server side then all you need to do is POST the index of the list that you want to get a handle on. For example: ... You would have a setter for listIndex to "receive" the value.

This is using a GET, if you want a POST you can do that and make the listIndex a hidden field. BUT, if you can't recreate the list on the server because the user has modified the list somehow in the browser and you need to preserve that, then you need Struts2 to create the list based on the POST'd parameters. You do that with some special syntax.

This creates fields with names like myList0. RequestId ... myList5.requestProof. If you have a setter for myList in your action and you POST these parameters to the action, Struts2 will build the List and populate the properties of the objects in the List.

You can use Generics List myList to tell Struts2 what kinds of "things" are in your List. You can also look at Type Conversion documentation for Struts2 if Generics doesn't work for you.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions