4

I have the following in my jsf xhtml page:

<h:body>
 <ui:define name="metadata">
 <f:metadata>
  <f:viewParam name="dummy"/>
  <f:event type="preRenderView" listener="#{bean.getDataMethod}"/>
  <f:attribute name="param1" value="${param.param1}"></f:attribute>
  <f:attribute name="param2" value="${param.param2}"></f:attribute>
 </f:metadata>
 </ui:define>

 <p:dialog header="Modify" widgetVar="modDialog" height="650" width="1500" resizable="false" showEffect="explode" modal="true" draggable="false" hideEffect="explode">
  <p:panel id="modifyPanel">
   <c:if test="#{null != bean.databean}">
    <ui:include src="modifyData.xhtml"></ui:include>
   </c:if>
  </p:panel>
 </p:dialog>
</h:body>

I need to display the modal dialog box after the preRenderView has been executed. And, I also need to make sure that all data will be displayed in the modal dialog box.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Angel
  • 63
  • 1
  • 5
  • What do you mean by *display the modal dialog box after the preRenderView*? `preRenderView` occurs on the server and a modal dialog can only be displayed on the client (basically opened using JavaScript). – LaurentG Jun 24 '13 at 10:44
  • I guess OP mean that after a complete loading of page, He wants to load the modal – Freak Jun 24 '13 at 11:20
  • Hi @LaurentG thank you for your comment. Yes, I would like to load the modal after page loading. – Angel Jun 25 '13 at 02:41

1 Answers1

12

Just set its visible attribute to true.

<p:dialog ... visible="true">

If you intend to display it on a condition which is determined during preRenderView, then just bind it to a boolean bean property the usual way.

<p:dialog ... visible="#{bean.dialogVisible}">

See also:

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