I have a page with two text fields and a commandButton, in one of the text field onBlur i’m calling onBlur() method in the bean and in the commandButton i’m calling onClick() method in the bean, every thing works fine except when i click the commandButton if the focus is on the text box with onBlur then only the onBlur method been called not both. I’ve attached the xhtml file and bean.
XHTML Code
<h:inputText id="service" value="#{onBlurTestBean.service}">
<a4j:support status="test" event="onblur"
action="#{onBlurTestBean.onBlur}" reRender="category" />
</h:inputText>
<a4j:htmlCommandLink id="submit" action="#{onBlurTestBean.onClick}"
ajaxSingle="true" value="Click!" />
Bean
public class OnBlurTestBean {
private String service;
private String category;
public void initialize(){
}
public void onBlur(){
log("onBlur");
try{
Thread.sleep(1000);
}catch(Exception e){
}
}
public void onClick(){
log("OnClick");
}
public void log(String msg){
System.out.println(msg);
}
}
The specified example in question works OK (both methods are invoked onBlur and onClick).
In you case it seems you have
a4j:statuscomponent which blocks user clicks (for example covers the layout with invisible div).To verify my assumption, try the following (
statusattribute removed,a4j:regionadded):