How do you create a dialog programmatically in Primefaces?
I have a page named tree.xhtml with a <p:tree/> and a tree node with a right-click contextmenu option that selects a bean.edit() method.
When the user clicks on the bean.edit() method, I want the method to display a dialog programmatically and I want to be able to create input elements or a drop down combo box with more than one element and a submit button. I have looked at the User’s guide and I do not see such an example so I am hoping you guys can show me how to do it here.
Many thanks in advance.
Joe
If you want to trigger the showup of a dialog programmatically you can use the
visibleattribute to do so:Your dialog in xhtml:
Your backing bean:
Your trigger e.g. a CommandButton: