I am using jquery struts2 grid plugin. I am using my own form to update, delete and insert object. I had created a hidden field to retrieved the value from javascript but it did not work... I also created a <s:textfield> it could not retrieve the value of the variable from javascript.. What seems to be the problem?
When I click the grid code below is activated.
var product_id = grid.jqGrid('getCell', sel_id, 'product_Id');
I want to pass the value of product_id to the hidden tag in struts2 by this.
document.getElementById('product_Id').value = product_id;
So it should pass the product_id value to product_Key field through this tag.
<s:hidden value="" name="product_Key" id="product_Id"/>
Then when i click the edit button on the grid, it should be passed as a paremeter through this lines.
<
s:url id="editurl" action="ProductUpdate">
<s:param name="product_Key"><s:property value="product_Key"/></s:param>
</s:url>
This is the edit click button.
Edit : {
title :'Edit record on the selected record on the row',
caption :'Edit Record',
icon:'ui-icon-pencil',
onclick: function(){ alert('Edit is clicked'),document.getElementById('product_Id').value = product_id,window.location = '%{editurl}' }
}
My Action Class