hibernate - jquery struts2 grid column editable="false" is not passed to server -
i created grid using jquery struts2 grid plugin. have grid column primary key of table set non-editable. when try edit 1 of rows of table in grid, key column not passed server. tried setting editable attribute of key column true that's time sent key server. in showcase, id set non-editable server receives parameter. kindly me out on this. might missing something.
here code jsp:
<s:url id="adm201_grid" action="adm201grid"> <s:param name="bomid" value="%{bom.bomid}"/> </s:url> <s:url id="adm201_edit_grid" action="adm201editgrid"> <s:param name="bomid" value="%{bom.bomid}"/> </s:url> <s:url id="select_material" action="select_material"/> <sjg:grid gridmodel="gridmodel" caption="bill of materials" href="%{adm201_grid}" datatype="json" pager="true" navigator="true" navigatorsearchoptions="{multiplesearch:true}" navigatoredit="true" navigatordelete="true" rowlist="10,15,20" rownum="15" editurl="%{adm201_edit_grid}" editinline="false" multiselect="true" width="500" navigatoraddoptions="{reloadaftersubmit:true}" navigatoreditoptions="{reloadaftersubmit:false}" > <sjg:gridcolumn name="bommatid" index="bommatid" title="bom material id"/> <sjg:gridcolumn name="material.materialid" title="material" sortable="true" editable="true" edittype="select" editoptions="{dataurl:'%{select_material}'}" formatter="integer" width="40"/> <sjg:gridcolumn name="material.descrip" title="description" sortable="true" width="150"/> <sjg:gridcolumn name="material.unit" title="unit" sortable="true" width="30"/> <sjg:gridcolumn name="quantity" title="quantity" sortable="true" editable="true" edittype="text" formatter="integer" width="40"/> </sjg:grid>
here code edit action:
public class adm201editgrid extends actionsupport { private static final long serialversionuid = 3887575129335166744l; private string oper; private bommaterials bommaterials; private bommaterialsdao bommatdao = new bommaterialsdao(); private long bomid; private material material; private long quantity; private long bommatid; // getters , setters @override @actions( { @action(value = "/adm201editgrid", results = { @result(name = "success", location = "simpleecho.jsp"), @result(name = "input", location = "simpleecho.jsp") }) }) public string execute() throws exception { if (oper.equals("add") || oper.equals("edit")) { bommaterials = new bommaterials(); bommaterials.setbomid(bomid); bommaterials.setbommatid(bommatid); bommaterials.setmaterial(material); bommaterials.setquantity(quantity); bommatdao.save(bommaterials, bommaterials.getbommatid()); } return success; } }
hoping immediate replies. lot!
~ honey =)
instead of setting editable false, try setting hidden true, in case it'll passed server , not visible in add/edit dialog box of grid.
Comments
Post a Comment