I am rendering a <p:outputLabel>, when validation failed like this.
<p:outputLabel value="Validation Failed"
styleClass="validation-error"
rendered="#{facesContext.validationFailed}"
onfocus="myMethod();"/>
I want to execute a JavaScript function namely myMethod(), when this label is rendered. I also used onfocus attribute but it doesn't work.