1

My page has one list and its going another page by redirecting to see details of record. Now i want to open a dialog instead of going another page.

Is it possible to reuse next managed bean for that dialog? Also i want that dialog handle its own actions by itself (don't want to add events of next page to my master page).

The sample code below works for visuality (adds components) but it doesn't work for the actions.

<p:dialog id="dialog" widgetVar="dialogWidget" >
        <ui:include src="#{nextPage.xhtml}" />
</p:dialog>
Kukeltje
  • 12,223
  • 4
  • 24
  • 47
eks
  • 11
  • 1
  • Possible duplicate of [How to ajax-refresh dynamic include content by navigation menu? (JSF SPA)](http://stackoverflow.com/questions/7108668/how-to-ajax-refresh-dynamic-include-content-by-navigation-menu-jsf-spa) – Vsevolod Golovanov Apr 08 '17 at 12:24
  • The key thing is that ui:include is a facelet templating tag, that gets processed when building the view, but all the processing/updating of components happens later. – Vsevolod Golovanov Apr 08 '17 at 12:26

1 Answers1

0

Be aware that when using Primefaces dialog, forms must be declare inside the dialog.

<p:dialog id="dialog" widgetVar="dialogWidget" >
   <h:form >
        <ui:include src="#{nextPage.xhtml}" />
   </h:form>
</p:dialog>

Also try to avoid overlap of forms if not, you will face issues while executing actions.

  • 1
    No, only when using appendTo with a value of @body, you need to make sure the dialog contains a form (or in similar when the resulting dialog is moved out of a form on the client). In other cases it is not a requirement. – Kukeltje Apr 07 '17 at 07:41