Q:

How to capture the selected rows in jquery grid when submitting as part of the form in Struts2

I am using jquery grid and Struts2.  I have displayed the jquery grid successfully.  Now i want to select rows from jquery grid plus other data outside grid and submit that in my struts action for processing.  I have a problem with retrieving the data from jquery grid.  can anyone help on how to access the rows that i have selected from jquery grid in my action? 
here is my jquery grid:
<s:form action="runTest" method="post">
                <sjg:grid
                    id="gridTable"
                    formIds="mcp"
                    caption="Test Scripts"
                    dataType="json"
                    href="%{searchurl}"
                    pager="true"
                    gridModel="gridTDP"
                    rowList="10,15,20,30"
                    rowNum="30"
                    multiselect="true"
                    viewrecords="true"
                    reloadTopics="reloadItems"
                    loadonce="false"
                    viewsortcols="[true, 'horizontal', true]"
                    resizable="true"
                >

                    <sjg:gridColumn name="idTestData"
                        index="idTestData"
                        key="true"
                        title="idTestData"
                        formatter="integer"
                        hidden="true"
                    />

                    <sjg:gridColumn name="testName"
                        index="testName"
                        title="Test Name"
                        width="50"
                        sortable="true"
                        search="true"
                        searchoptions="{sopt:['eq','ne','lt','gt']}"
                    />
                    <sjg:gridColumn
                        name="projectName"
                        index="projectName"
                        title="Project Name"
                        width="300"
                        sortable="true"
                        edittype="text"
                    />

                </sjg:grid>

                <sj:submit value="Execute Test Scripts"/>
            </s:form>

Here is the runTest.action which is successfully called on but not getting the jquery grid rows:
public String runTest() throws Exception{

        Iterator<Test> gridIterator = gridTDP.iterator();

        System.out.println(" running test--");
        while(gridIterator.hasNext()){

            System.out.println(" in the gridIterator");
        }

        return "success";
    }

A:

If I am correct I think this might work.. If not let me know. 
var checks=$("#gridtable").find('input[type=checkbox]');
               var va =new Array();
              // alert(checks.length);
                for(var i=0;i<checks.length;i++)
                    {
                        if(checks[i].checked)
                            {
                             var p = checks[i].parentNode.parentNode;
                             var id=p.id;

                            va.push($("#gridtable").jqGrid('getCell',id,'cellvalue'));
                //          alert(va);
                            }
                    }
               document.getElementById("hiddenVariableID").value=va; 

that cellvalueis the value that you want to send to the action class.  
I think in your case it can be any column name.  
in your jsp add thi line
<s:hidden id="hiddenVariableID" name="selectedRows" />

And in your action class create Getters and setters for selectedRows with the type as array 

