ViewAction action not executing when the page has been submitted via commandbutton in a data table

16 views Asked by At

I have JSF page eventListEdit.xhtml that displays a data table with a commandbutton in every row to edit the data displayed via a eventCreateEdit.xhtml page. Here is my eventlistEdit.xhtml table with the commandbutton

    <p:column style="width:50px;">
    <p:commandButton id="editButton" action="#{eventListEditModel.edit}" update="@form"  icon="ui-icon-pencil" title="Edit">
    <f:setPropertyActionListener value="#{projectEvent}"  target="#{eventListEditModel.editProjectEvent}"   />
    <f:param name="projectEventId" value="#{projectEvent.projectEventId}"/>
    </p:commandButton>
    </p:column>

My eventCreateEdit.xhtml is displayed via a return url from my backing bean as follows

        public String edit(){
        return "/rem40/eventCreateEdit.xhtml?"+"projectEventId="+editProjectEvent.getProjectEventId();

}

my eventCreateEdit.xhtml has the following in the metadata

        <f:metadata>
        <f:viewParam name="projectEventId" value="#{eventCreateEditModel.projectEventId}"/>
        <f:viewAction action="#{eventCreateEditModel.onPageLoad}" />
       </f:metadata>
<ui:define name="bodyContent">
    <h:form id="form">

There seems to be a problem in that eventCreateEditModel.onPageLoad() never executes nor does the viewParam get set in the new page from the request parms. The JSF page eventCreateEdit.xhtml does display. Why doesn't the viewParam nor viewAction not work in this scenario?

0

There are 0 answers