hi, how to trigger onerror of f:ajax inside a h:commandButton from it's action method?
<h:form>
<h:inputText id="i1" value="#{bean.i1}"/>
<h:commandButton id="go" action="#{bean.process}" value="go">
<f:ajax render="o1" onerror="myfunction();"/>
</h:commandButton>
<h:outputText id="o1" value="#{bean.o1}"/>
</h:form>
then in the bean
public String process() {
if(isOK()) {
calculate();
return null;
} else {
//here I want to send an ajax error, to trigger the onerror function in the client
}
}
I don't know what I must do inside the action method to signalize an ajax error. Do I have to throw a specific Exception or any run time exception, or another approach?