1

I have a Primefaces 5.0 p:dialog page invoked by populated dynamic menuitem (DefaultMenuItem) when clicked and displayed in modal, which shows perfectly fine.

The p:dialog contains a p:dataTable with the last column contains p:commandLink that is supposed to call a ManagedBean method. apparently, the bean method is not fired when the commandLink is clicked and when it is clicked, the p:dialog cannot be closed when the "x" is clicked.

Here's the population of the menu:

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 where the dynamic menu is from:

        <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>

...

The page where the p:dialog is located at:

<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"/>

Is there anything wrong or missing causing the p:commandLink not to call the bean?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555

0 Answers0