0
votes

I am into development of an application using primefaces. My issues is I have P:layout of which is having north, south and center layout, the center layout has dynamic include of the xhtml page the pageRoot value of a backing bean contain the xhtml page name. The layout is enclosed in the "h:form"

<p:layoutUnit position="center">
  <p:panel id="centreContent" style="border: none; margin-top: -15px; margin-left: -20px;">
    <ui:include src="#{menu.pageRoot}"/>
  </p:panel>
</p:layoutUnit>

At Some point the pageRoot property includes a page having a dataList to show multiple link of commandlink like below

<p:panel id="topPnlCourseData" header="Course Data" toggleable="false" style="font-size: 12px; height: 250px;">
  <p:dataList id="topPnlCourseDataList" value="#{studentStudyMaterial.mainCourseList}"
        var="courseList" type="unordered" itemType="none" paginator="true" rows="10" styleClass="paginated">
    <p:commandLink id="topPnlCourseDataListCmdLink" process="@this topPnlCourseDataList"
          update="topPnlCourseDataListDialogPnl" oncomplete="PF('topPnlCourseDataListDialogPnl').show()"
          title="View Detail">
      <f:setPropertyActionListener id="topPnlCourseDataListCmdLinkListener" value="#{courseList}"
            target="#{studentStudyMaterial.mainCourse}" />
      <h:outputText value="#{courseList.mainCourseAbbriviation}"/>
    </p:commandLink>
    <h:outputText value="#{courseList.mainCourseAbbriviationDetail}" style="display:inline-block"/>
    <p:dialog id="topPnlCourseDataListDialogPnl" header="Course Info" widgetVar="topPnlCourseDataListDialogPnl"
          modal="true" showEffect="blind" hideEffect="explode" resizable="false" dynamic="true">
      <p:panelGrid  columns="2" rendered="#{not empty studentStudyMaterial.mainCourse}" columnClasses="label,value">
        <h:outputText value="Id:"/>
        <h:outputText value="#{studentStudyMaterial.mainCourse.mainCourseAbbriviation}" />
        <h:outputText value="Year" />
        <h:outputText value="#{studentStudyMaterial.mainCourse.mainCourseAbbriviationDetail}" />
        <h:outputText value="Color:" />
        <h:outputText value="#{studentStudyMaterial.mainCourseDetail.mainCourseLevelAbbriviationDetail}"/>
      </p:panelGrid>
    </p:dialog>
  </p:dataList>
</p:panel>

Now the f:setPropertyActionListener is setting the selected values in backing bean and I am setting another property during that call in the Backing Bean itself as well within that setter on behalf of the selected property, i.e. main course and detailed course is subset of main course of type List. The main course values is set and details course values is also set in backing bean. On clicking the link rendered on xhtml page, the dialog box rendered but the values in subset of the selected link do not appear though the maincourse values appear.

Any idea/suggestion what I am doing wrong?

1
Try putting the dialog outside the dataList. You now generate a dialog with an identical widgetId for each 'record' in the datalist (and that is not ok). And please create an minimal reproducible example when asking question. Is e.g. the layout relevant? If not remove it.Kukeltje

1 Answers

-1
votes

Add p:outputPanel before panelgrid in dialog and updated value p:outPanel its show when dialog rendered