Time for action – showing the search users screen in dialog
Let us see how we can display the search users page (searchUsers.xhtml
) in the Dialog component.
Create a
CommandButton
button whoseactionListener
triggers open the dialog using theRequestContext.openDialog()
method:<p:commandButton value="Search Users" actionListener="#{userController.searchUsersForm}" /> public void searchUsersForm() { RequestContext.getCurrentInstance().openDialog("searchUsers"); }
Create the search users page
searchUsers.xhtml
as follows:<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> <h:head> <title>Search Users</title> </h:head> <h:body> <h:form> <p:inputText value="#{userController...