我试图在sjg:grid单元格中编辑一个单元格,完成后应该调用editControlParam URL,而是调用表格URL,重新加载表格,我的jsp标记中有一个sjg:grid
<s:url id="controlParameterTableURL" namespace="/global" action="loadControlParametersTable"/>
<s:url id="editParameterUrl" namespace="/global" action="editControlParameter"/>
<tr>
<td>
<sjg:grid id="controlparameterGrid" caption="%{getText('controlparametersearch.title')}" dataType="json" href="%{controlParameterTableURL}" pager="true"
gridModel="controlParameterList"
rowList="%{session.sessionAttr.pref.tableRowlist}"
rowNum="15"
rownumbers="true"
viewrecords="true"
cellEdit="true"
cellurl="%{editParameterUrl}"
onSelectRowTopics="rowselect" gridview="true"
onGridCompleteTopics="gridComplete" footerrow="true"
>
<sjg:gridColumn name="id" align='left' index="id" title='Id' hidden="true"/>
<sjg:gridColumn width="200" name="code" align='left' index="code" title='%{getText("controlparameteraction.controlparametercode")}' sortable="true"/>
<sjg:gridColumn width="200" name="name" align='left' index="nName" title='%{getText("controlparameteraction.controlparametername")}' sortable="true"/>
<sjg:gridColumn editrules="{required: true}" editable="true" width="200" name="value" align='left' index="name" title='%{getText("controlparameteraction.controlparametervalue")}' sortable="true"/>
<sjg:gridColumn width="200" name="status" cssStyle='text-align:right' hidden='true' index="status" title='%{getText("model.status")}'/>
</sjg:grid>
这是我的struts xml
<action name="editControlParameter" method="editControlParameter" class="controlParameterAction">
<result name="success">/pages/global/globalbase.jsp?nextpath=/pages/global/&nextpage=controlparam
</result>
<result name="error">/pages/global/globalbase.jsp?nextpath=/pages/global/&nextpage=controlparam
</result>
</action>
请帮忙。
答案 0 :(得分:1)
I finally resolved my issue by add @SkipValidation on the method (from struts2-core-x.x.x.jar)
@SkipValidation
public String editControlParameter() throws Exception{
ControlParameterData data = ((ControlParameterData) getData());
UserIdentificationToken userId = getUserIdentificationToken(getServletRequest());
ControlParameterData d = controlParameterService.findControlParameterByPK(data.getId(), userId);
d.setValue(data.getValue());
ControlParameterData createdData = controlParameterService.modifyControlParameter(d, userId);
setDataParameters(d, createdData);
return SUCCESS;
}
Having to work for an organization maintaining legacy codes ,this is what you face