页面上提交List对象
QueryCondition
在页面上迭代List<QueryCondition> conditionList
- public class QueryCondition {
- private String name;
- private String alias;
- private int type;
- private String stringValue;
- private String[] values;
- private boolean isValues = false;
- private boolean isConstraint = false;
- private Constraint constraint;
- .......(get set 方法省略)
- }
JSP页面
- <s:iterator value="conditionList" status="st" >
- <tr>
- <s:hidden name="conditionList[%{#st.index}].name" value="%{name}"/>
- <s:hidden name="conditionList[%{#st.index}].alias" value="%{alias}"/>
- <s:hidden name="conditionList[%{#st.index}].type" value="%{type}"/>
- <s:hidden name="conditionList[%{#st.index}].isValues" value="%{isValues}"/>
- <s:hidden name="conditionList[%{#st.index}].isConstraint" value="%{isConstraint}"/>
- <td height="25" align="right" class="STYLE2"><s:property value="alias"/>:</td>
- <td class="leftpadding">
- <s:if test="type==0"><input type="text" name="conditionList[${st.index}].stringValue" value=""/></s:if>
- <s:elseif test="type==1"><input type="text" name="conditionList[${st.index}].stringValue" value="" /></s:elseif>
- <s:elseif test="type==2">
- <s:if test="isConstraint">
- <s:if test="isValues">
- <s:checkboxlist name="conditionList[%{#st.index}].values" list="constraint.readMultipleValues()" theme="simple" value=""/>
- </s:if>
- <s:else>
- <s:select name="conditionList[%{#st.index}].stringValue1" list="constraint.readMultipleValues()" theme="simple" emptyOption="true" value=""/>
- </s:else>
- </s:if>
- <s:else>
- <input type="text" name="conditionList[${st.index}].stringValue1" value=""/>
- </s:else>
- </s:elseif>
- <s:elseif test="type==4"><input type="text" name="conditionList[${st.index}].stringValue" value="" /></s:elseif>
- <s:elseif test="type==3">
- <s:radio name="conditionList[#st.index].stringValue" list="#{'true':'true','false':'false'}" theme="simple" value=""/>
- </s:elseif>
- </td></tr>
- </s:iterator>