stripes:options-collection
From Evernote: |
stripes:options-collection |
stripes:option forEach
public List<MenuItem> getMenuItems() {
return menuItems ;
}
<th> 上層程式</th >
<td colspan ="4" >
<stripes:select id ="menuItemPk" name="createMenuItem.parentMenuItem.menuItemPk" disabled="true" >
<stripes:option value ="" label="-- 請選擇 --" />
<c:forEach items =" ${actionBean.menuItems }" var="menuItem" varStatus="rowstat" >
<stripes:option value =" ${menuItem.menuItemPk }" label =" ${menuItem.actionName }"/>
</c:forEach>
</stripes:select>
</td>
stripes:options-collection
public List<MenuItem> getParentMenuItemOptions() {
return parentMenuItemOptions ;
}
<th >程式類別</ th>
<td colspan ="4" >
<stripes:select id ="parentMenuIdx" name="qryParentMenuItemPk" >
<stripes:option value ="" >-- 請選擇 --</stripes:option>
<stripes:options-collection collection=" ${actionBean.parentMenuItemOptions }" label="actionName" value="menuItemPk" />
</stripes:select>
</td>
stripes:option forEach and Custom class
public List<LabelValue> getRoleNoList(){
List<LabelValue> list = new ArrayList<LabelValue>();
Long userGroupPk = UserUtil.getUserGroup().getGroupPk();
list = roleService.findLabelValueByGroupPk(userGroupPk);
return list;
}
<tr>
<th> 角色名稱<span id="mustKeyInStar" >**</ span></th >
<td colspan ="4" >
<stripes:select id ="qryRolePk" name="rolePk" >
<stripes:option value ="" label="-- 請選擇 --" />
<c:forEach items=" ${actionBean.roleNoList}" var="roleObj" varStatus ="rowstat" >
<stripes:option value=" ${roleObj.value}" label="${roleObj.label} " />
</c:forEach>
</stripes:select>
</td>
</tr>
留言
張貼留言