1

I am facing an issue when trying to add javascript function to be called after the command button is called but I am only getting the javascript fuction "forGo()" being called but not the function register located in the managed bean when I remove the p:ajax code the function is executed succesfully but I need the forGo function to be executed too, I wrote this code two years ago and it was working fine, any advice would help, thanks.

<p:commandButton value="Register" actionListener="#{ClientMB.Register()}" >
                                            <p:ajax event="click" oncomplete="forGo()"></p:ajax>
                                            </p:commandButton></h:form>
0

1 Answer 1

4

I would suggest to remove the <p:ajax> and just use the <p:commandButton> oncomplete attribute directly:

<p:commandButton value="Register" actionListener="#{ClientMB.Register()}" oncomplete="forGo()" />
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.