1

I have four columns in a data table out of which I need to use two command links for two separate actions and I need a context menu with two menu items. The Context Menu displays and the action Listeners fire only with columns having output text only and fails for columns having command links with this error

Received 'java.lang.NullPointerException' when invoking action listener '#{displayIssuesBean.moveIssue()}' for component 'moveIssueFromNextSprintToCurrentSprint'
17:29:51,524 SEVERE [javax.faces.event] (http--127.0.0.1-8080-6) java.lang.NullPointerException 

I even tried with command Buttons but the problem continues please help me thanks in advance

Is there any way so that the context menu can be employed only one single column and selection takes the entire row and action listeners of context menu works ?

<p:contextMenu for="currentSprint">
    <p:menuitem id="moveIssueFromCurrentSprintToNextSprint"
        value="#{msg['prometheus_movetonextsprint']}"
        icon="ui-icon-circle-arrow-s"
        update="currentBacklog,currentSprint,nextSprint"
        actionListener="#{displayIssuesBean.moveIssue}">
        <f:param name="fromIssue" value="3" />
        <f:param name="toIssue" value="2" />
    </p:menuitem>
</p:contextMenu>

<p:dataTable id="currentSprint" var="currentSprintList"
    value="#{displayIssuesBean.currentSprintList}" scrollable="true"
    style="width:1000px;"
    emptyMessage="#{msg['prometheus_issuesdisplayemptymessage']}"
    draggableRows="true" rowKey="#{currentSprintList.title}"
    sortBy="#{currentSprintList.priorityOrder}"
    selection="#{displayIssuesBean.currentSprintSelectedIssue}"
    selectionMode="single" ajax="false">

    <p:ajax event="rowReorder"
        listener="#{displayIssuesBean.onRowReorderCurrentSprint}"
        update="currentSprint" />

    <f:facet name="header">#{msg['prometheus_issues']}</f:facet>

    <p:column headerText="#{msg['prometheus_priority']}">
        <h:outputText value="#{currentSprintList.priorityOrder}" />
    </p:column>

    <p:column headerText="#{msg['prometheus_number']}">
        <p:commandLink action="#{menuBarBean.navigateToModifyIssue}"
            value="#{currentSprintList.issueNumber}" ajax="false">
            <f:setPropertyActionListener target="#{modifyIssueBean.issueId}"
                value="#{currentSprintList.issueNumber}" />
        </p:commandLink>
    </p:column>

    <p:column headerText="#{msg['prometheus_title']}">
        <h:commandLink action="#{menuBarBean.navigateToViewIssue}"
            value="#{currentSprintList.title}" target="_blank">
            <f:setPropertyActionListener target="#{viewIssueBean.issueId}"
                value="#{currentSprintList.issueNumber}" />
            <f:setPropertyActionListener target="#{viewIssueBean.locale}"
                value="#{loginBean.locale}" />
        </h:commandLink>
    </p:column>

    <p:column headerText="#{msg['prometheus_type']}">
        <h:outputText value="#{currentSprintList.issueType}" />
    </p:column>

</p:dataTable>
Vsevolod Golovanov
  • 4,068
  • 3
  • 31
  • 65
  • 1
    Was there an exception stack in the log? What's your JSF implementation and version? What's the PrimeFaces version? – Vsevolod Golovanov Jul 16 '15 at 08:43
  • the exception was mention in the description, action listeners of context menu wont fire on columns which contains command links. – TEDDY Jul 18 '15 at 09:05

0 Answers0