我有一个Primefaces 5.0 p:对话框页面,当被点击并以模态显示时,由填充的动态菜单项(DefaultMenuItem)调用,显示完全正常。
p:对话框包含一个p:dataTable,最后一列包含应该调用ManagedBean方法的p:commandLink。显然,单击commandLink时不会触发bean方法,单击它时,当" x"时,不能关闭p:对话框。点击。
这里是菜单的人口:
DefaultMenuItem menuItem = new DefaultMenuItem(taskMenuDefinition.getMenuDisplayTxt());
menuItem.setCommand(expression);
menuItem.setImmediate(true);
menuItem.setAjax(true);
menuItem.setTitle(taskMenuDefinition.getMenuDisplayTxt());
menuItem.setImmediate(true);
menuItem.setTarget("#{commonPageLayout.mainIncludePage}");
menuItem.setOncomplete("PF('taskStatusChooseUserDialog').show()");
menuItem.setUpdate(":taskStatusChooseUserDialogId :taskStatusChooseUserForm");
this.actionMenuModel.addElement(menuItem);
动态菜单来自的XHTML:
<div class="panel-menus" style="margin-right: 50px">
<h:form id="menuButtonForm"
binding="#{taskMenuDefinitionRequestBean.menuButtonForm}">
<p:menuButton
value="#{msgMenuTaskMenuDefinition['button.taskMenuDefinition.action.name']}"
model="#{taskMenuDefinitionRequestBean.actionMenuModel}"
binding="#{taskMenuDefinitionRequestBean.menuButton}" />
</h:form>
</div>
...
p:对话框所在的页面:
<p:dialog id="taskStatusChooseUserDialogId" modal="true" style="style ommitted"
resizable="false" header="#{taskMenuDefinitionRequestBean.userSelectTitle}" appendTo="@(body)"
widgetVar="taskStatusChooseUserDialog">
<h:form id="taskStatusChooseUserForm">
<div id="searchResultPnl">
<p:dataTable id="approverResultsId" lazy="true" rowIndexVar="rowIndex"
var="userSelectionVar" value="#{taskMenuDefinitionRequestBean.userList}" rowStyleClass="even,odd"
emptyMessage="#{msg['msg.no.matching.records']}">
<p:column headerText="#{msg['label.operation']}" style="white-space: nowrap" >
<p:commandLink styleClass="icon-assign-task icon" immediate="true" update=":main"
ajax="true" process="@all" oncomplete="PF('taskStatusChooseUserDialog').hide()"
action="#{taskMenuDefinitionRequestBean.changeTaskStatusWithUser(userSelectionVar.userId)}">
<f:setPropertyActionListener value="/xhtml/casefile/applicant.xhtml"
target="#{commonPageLayout.mainIncludePage}"/>
</p:commandLink>
</p:column>
</p:dataTable>
</div>
</h:form>
<script type="text/javascript"/>
是否有任何错误或缺失导致p:commandLink不调用bean?