There is a page in which there are multiple rows with a ‘Change Status’ button[a ‘submit’ button] at the end of each row. There are more than ten status present. When I click on the ‘Change Status’ button, the control goes the action class and the page reloads with the changed status.
I have id’s associated with each row. how do I identify in which row I have clicked the ‘Change Status’ button when the page reloads ? Should I pass the id through java-script to the action class ? Is there a simpler way than this ?
Well you can take advantage of Struts2 multiple submit button functionality.Like you can set submit button value based on your ID and collect that in your action to use it in your way something like
So in short value can be what is the uniqque id and you can use it in action as per your choice
for details