Jåc*_*cob 4 radio-button primefaces jsf-2
我有一个使用JSF2.0的数据表,其中我有使用radiobutton显示的行
<p:dataTable id="dataTable" var="emp" lazy="true" value="#{req.lazyModel}"
paginator="true" rows="10"
paginatorTemplate="{CurrentPageReport}
{FirstPageLink} {PreviousPageLink}
{PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10"
selection="#{req.selectedEmp}"
rowKey="#{req.empNo}"
rowSelectListener="#{req.onRowSelect}">
<p:column selectionMode="single" style="width:18px" />
Run Code Online (Sandbox Code Playgroud)
在Bean我有
public void onRowSelect(SelectEvent event) {
System.out.println("row "+((Request) event.getObject()).getEmpNo());
}
Run Code Online (Sandbox Code Playgroud)
但是onRowSelect不会调用方法.这可能是什么原因?
我对radiobutton的想法是当用户点击radiobutton时,我想在主数据表下面显示一个数据表,其中包含所选行的详细信息.
任何帮助都非常感谢.
更新1
<p:dataTable id="dataTable" var="emp" lazy="true" value="#{req.lazyModel}"
paginator="true" rows="10"
paginatorTemplate="{CurrentPageReport}
{FirstPageLink} {PreviousPageLink}
{PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10"
selection="#{req.selectedEmp}">
<p:column selectionMode="single" style="width:18px" />
<p:ajax event="rowSelect" listener="#{reqMB.onRowSelect}" />
Run Code Online (Sandbox Code Playgroud)
Dan*_*iel 15
有没有这样的属性rowSelectListener在Primefaces 3.4.2
使用<p:ajax event="rowSelect"相反,就像展示一样
对于广播/复选框等...这些是可用的<p:ajax事件
查看showcase(在页面上搜索p:ajax) DataTable - 选择
| 归档时间: |
|
| 查看次数: |
16041 次 |
| 最近记录: |