I'm implementing attendance sheet in S2. I need to select only one checkbox among three (P, A, L). User may select all at once if they want. Finally they will take attendance. All these stuff completed. See the below picture for understanding completely.
After clicks on button I make an Ajax call. So the selected values will be send to action class like P##1,L##2,P##3,L##4,P##5,P##6,A##7,P##8,A##9,P##10. In action class, I'll split it while processing request. Is it right way to pass parameters. Can you please tell me is the any other solution to do this.
In JSP
<s:iterator value="listOfEmployees">
<s:property value="%{empCode1}" />
<s:checkbox name="somename%{empCode}" fieldValue="P##%{empCode}" theme="simple" cssClass="first"/>
<s:checkbox name="somename%{empCode}" fieldValue="A##%{empCode}" theme="simple" cssClass="second"/>
<s:checkbox name="somename%{empCode}" fieldValue="L##%{empCode}" theme="simple" cssClass="third"/>
</s:iterator>
In JS, after clicks on button all the checked values will come. With the below line I got above parameter. 1, 2, etc are Ids (assume) and P - present, etc.
values+=$(this).val()+",";//now values=P##1,L##2,P##3,L##4,P##5,P##6,A##7,P##8,A##9,P##10
xmlhttp.open("GET","actionname.action?ids="+values,true);//call action