user2307786 user2307786 - 1 year ago 32
Javascript Question

there is a way to call javascript function from prime faces

I tried to call javascript function in my xhtml page by using RequestContext but I could not succeed it. Is there a way to call javascript function from view bean at prime faces ?

If the questions is not clear then I can provide code.

Answer Source

Like @Parkash Kumar said, you can call it from the bean, like this:

RequestContext.getCurrentInstance().execute("alert('script called.')");

or directly from the xhtml:

<p:commandButton value="Save" actionListener="#{}" oncomplete="handleComplete(xhr, status, args)" />
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download