Tuesday, June 10, 2014

Calling Primefaces dialog box from Managed Bean

If you are want to Calling Primefaces dialog box from Managed Bean  using the RequestContext class. Suppose you have the following:

....

So the way you do in the facelet itself, i.e. onclick=myDialogVar.show();, the same can be done in your managed bean like so:
RequestContext context = RequestContext.getCurrentInstance();
context.execute("myDialogVar.show();");

This is just a simple example. You can pass in arguments and set callbacks as well. Refer to the showcase example in the link.

0 komentar:

Post a Comment