0

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?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
snafua
  • 75
  • 1
  • 14
  • 1
    You've two problems. The main problem is answered in the duplicate. The second problem is answered here http://stackoverflow.com/questions/9856847/when-using-uicomposition-templating-where-should-i-declare-the-fmetadata – BalusC Dec 08 '15 at 22:19
  • Thanks, both answered my question. – snafua Dec 10 '15 at 20:39

0 Answers0