JSF批量删除问题?请帮帮小弟啊

cfpl12011124 2008-08-07 09:50:29
JSF页面有一循环显示的列表,没项前面有一复选框按钮。请问怎么在后台得到所选项的ID。
我的JSF代码如下:
<h:form id="form1">
<table align="center" border="0" cellspacing="1" width="100%" class="small" cellpadding="3">
<tr><td colspan="5" align="center" class="gray-bar"><font size="4">该类别已有的用品如下</font></td></tr>
</table>
<table>
<tr>
<td colspan="5" align="right">
<h:commandButton styleClass="button" value="删除用品" action="#{category.deleteArticle}"/>
<h:commandButton styleClass="button" value="更新用品" action="modifyArticle"/>
</td>
</tr>
</table>
<h:dataTable id="articleList" value="#{category.articles}" var="article" headerClass="gray-bar" width="100%">
<h:column>
<f:facet name="header">
<h:outputText value="选择"/>
</f:facet>
<h:selectBooleanCheckbox id="articleIds" value="#{category.checked}"/>
</h:column>

<h:column>
<f:facet name="header">
<h:outputText value="用品编号"/>
</f:facet>
<h:outputText value="#{article.articleId}"/>
</h:column>

<h:column>
<f:facet name="header">
<h:outputText value="用品名称"/>
</f:facet>
<h:outputText value="#{article.articleName}"/>
</h:column>

<h:column>
<f:facet name="header">
<h:outputText value="计量单位"/>
</f:facet>
<h:outputText value="#{article.unit}"/>
</h:column>

<h:column>
<f:facet name="header">
<h:outputText value="当前价格"/>
</f:facet>
<h:outputText value="#{article.currentPrice}"/>
</h:column>
</h:dataTable>
<h:panelGrid>
<h:panelGroup>
<h:selectBooleanCheckbox id="selectAll" style="margin-left:0px;"
onclick = "javascript:selectAll(this, 1, #{category.articleSize})"/>
<h:outputLabel value="全选" for="selectAll"/>
</h:panelGroup>
</h:panelGrid>
</h:form>
...全文
72 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

10,608

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 其他
社区管理员
  • 其他
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧