日期:2014-05-18  浏览次数:20666 次

从数据库里面获取list,在页面上怎么样让html:multibox是选中?
<tr>
<td> 用户管理 </td>
</tr>
<tr>
<td> &nbsp;&nbsp;&nbsp;
<html:multibox   property= "search_popedom.check_pope "   value= "1 "   /> 账户管理&nbsp;&nbsp;   &nbsp;   &nbsp;   &nbsp;  
<html:multibox   property= "search_popedom.check_pope "   value= "2 "   /> 修改密码&nbsp;&nbsp;   &nbsp;   &nbsp;   &nbsp;  
<html:multibox   property= "search_popedom.check_pope "   value= "3 "   /> 权限管理&nbsp;
</td>
</tr>
<tr> <td> &nbsp; </td> </tr>
<tr>  
<td> 资料管理 </td>
</tr>  
<tr>
<td> &nbsp;&nbsp;&nbsp;
<html:multibox   property= "search_popedom.check_pope "   value= "4 "   /> 地图管理&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<html:multibox   property= "search_popedom.check_pope "   value= "5 "   /> 编辑卡信息&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;      
<html:multibox   property= "search_popedom.check_pope "   value= "6 "   /> 查询卡信息  
</td>

从数据库里面获取的id是1,3,5,6
那我在页面上让让value是1,3,5,6选中?


------解决方案--------------------
混合适

<html:multibox property= "search_popedom.check_pope " value= "3 " <%if(list.contains( "3 ")){%> checked <%}%> /> 权限管理&nbsp;


<html:multibox property= "search_popedom.check_pope " value= "1 " <%if(list.contains( "1 ")){%> checked <%}%> /> 账户管理&nbsp;&nbsp;
------解决方案--------------------
返回的value跟 <html:multibox property= "search_popedom.check_pope " value= "4 " /
对应上,他就会自动选中