Navigating to another page in AJAX calls

PrimeFaces' users often ask "Why don't navigations work with PrimeFaces CommandButton and CommandLink?", "How can we navigate to any page on a node click in a Tree?", or "How can we change the view when a row in a DataTable is double-clicked?". These are questions that are mainly related to JSF rather than PrimeFaces, but we will give answers to these questions in this book due to their importance.

In this recipe, we will show a programmatic navigation with JSF NavigationHandler as well as a declarative way to do a cross-page navigation in AJAX calls.

How to do it...

All three questions mentioned above have the same nature. JSF and PrimeFaces do not support a forward-based navigation within an AJAX request. ...

Get PrimeFaces Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.