1

I'm using JSF 2 and Primefaces 5 and I have a problem using the onsucccess or oncomplete attribute on the commandButton component.

<p:commandButton value="Send" action="#{mybean.myMethod}" ajax="true" update=":myForm" process="@form" oncomplete="trackConv(id,value);" /> 

Many validations has to be performed, so that at the end (the javaScript (Google conversion) code is executed. When the oncomplete attribute is not there, the validation works. When I put the onsucccess or oncomplete attribute the validation doesn't work and nothing happens. The commandButton action is not fired at all!

What am I missing here? Thanks

I have a second question, should I use onsuccess or oncomplete attribute to execute my Google conversion?

EDIT:
I'm using both declarative (required field) and imperative (backing bean) validation.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
codyLine
  • 509
  • 2
  • 8
  • 26

0 Answers0