I would like your help. I am developing a system in JSF, and I have the following need: I would like to pass a bean function as an argument to a function of mine in JS, so that I determined future moment I can call such a function. For example:
..Server Side..
class oi{
void diga ola(){}
}
....Xhtml Page....
function foo(f){}
foo(#{oi.ola()});
.....
Oh, you could tell me to use the "p: remoteCommand" which is a component of primefaces, though the code would look ridiculously large. I have already noticed that it generates a function called "PrimeFaces.ab (...)", but unfortunately I did not understand how it recognizes the function that should be called and I have not found a documentation that shows how it works.
What I want to do is a dialog where the content is generic, and this functionality already works. However, I'd like to be able to call a bean function when the dialog is closed so it's hj:
<p:menuitem action="#{função quando abre dialog}" oncomplete="wizardComponent.openDialog('título do dialog,'conteudododialog.xhtml')" value="texto apresentado no menu "/>
In case I wanted to pass another argument to function, like this:
openDialog("título do dialog,'conteudododialog.xhtml', #{função a ser chamada quando o dialog fechar})
Any suggestions are welcome.