Handle success page and error p:messages using p:dialog

Posted: August 27, 2012 in web
The trick is to use action and actionListener att. No need to hide the modal.


            <p:dialog modal="true" widgetVar="add">
                <p:inputText value="#{c.label}" id="label" />
                <p:watermark value="label" for="label" />

                <p:commandButton action="page2?faces-redirect=true" value="Add"
                    actionListener="#{bean.onAdd()}" />
            </p:dialog>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s