Tuesday, August 19, 2008

Struts - Dropdown List

<display:table name="data.cardList" id="dataDetail" pagesize="${page}" requestURI=" style="width:100%">
<display:column headerClass="rowHeader">
<input type="radio" name="ipSelection" />
</display:column>

<display:column titleKey="de.action" headerClass="rowHeader" style="text-align:center">
<select name="action" onchange="setAction('${dataDetail.cardRef}','${dataDetail.cp}')" >
<option> Please select</option>
<c:forEach var="act" items="${actionList}">
<s:if test="${dataDetail.status==act.state}">
<option value="${act.code}"> ${act.description}</option>
</s:if> </c:forEach> </select>
</display:column>

</display:table>

**************************
- dataDetail.cardRef & dataDetail.cp should be the variables in cardList object
- act.code & act.description should be the variables in actionList object
- actionList is store in session

No comments: