O'Reilly logo

PrimeFaces Beginner's Guide by K. Siva Prasad Reddy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introducing dialog framework

PrimeFaces 4.0 introduces a new dialog framework, which can be used to generate dynamic dialog components at runtime with the content from any external facelets page.

In order to use a dialog framework, first we need to configure DialogActionListener, DialogNavigationHandler, and DialogViewHandler in faces-config.xml as follows:

<faces-config ...>
  <application>
    <action-listener>
    org.primefaces.application.DialogActionListener
  </action-listener>
    <navigation-handler>
    org.primefaces.application.DialogNavigationHandler
  </navigation-handler>
    <view-handler>
    org.primefaces.application.DialogViewHandler
  </view-handler>
  </application>
</faces-config>

We can use the RequestContext.openDialog() and RequestContext.closeDialog() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required