在下面的代码中,我尝试从<display:column>
标记传递2个参数。我必须将code
和level
属性传递给某个操作(如下所示)。我无法将另一列的值作为参数传递给列。在这里,我没有在level
属性中获得code
属性的值。
<s:form action="levelHierarchy">
<display:table id="searchList" name="searchList" pagesize="8"
export="false" requestURI="/getComponentDetails" sort="list">
<display:column property="code" title="Code" sortable="true" paramId="levelId" href="levelHierarchy.action?level=${searchList.level}"></display:column>
<display:column property="description" title="Description" sortable="true" />
<display:column property="level" title="Level" sortable="true" />
<display:setProperty name="paging.banner.placement" value="bottom" />
</display:table>
</s:form>
答案 0 :(得分:0)
在表单中,您没有要提交的任何字段。您应该至少为包含要传递给操作的值的列定义hidden个字段。您还需要使用uid
标记的<display:table
属性来访问行值。
<display:table uid="row" id="searchList" name="searchList" pagesize="8" export="false" requestURI="/getComponentDetails" sort="list" >
<display:column property="code" title="Code" sortable="true" paramId="levelId" href="levelHierarchy.action?level=${searchList.level}">
<s:hidden name="submitList[%{#attr.row_rowNum - 1}]" value="%{#attr.row.code}"/>
</display:column>
<%-- Other columns like that --%>
</display:table>
在操作中,您应该为提交的值创建属性占位符。