I have multiple input field with a p:ajax with a listener. They all connect to the same listener. How can I know what component triggerd the listener?
The AjaxBehaviorEvent is not specific to RichFaces. It's specific to JSF2 itself. So you can just keep using it in PrimeFaces.
public void retrievePostalCodeCity(AjaxBehaviorEvent event) {
UIComponent component = event.getComponent();
// ...
}
As an alternative, or for the case that it's really not possible elsewhere, you could always use the new JSF2 UIComponent#getCurrentComponent() method.
public void retrievePostalCodeCity() {
UIComponent component = UIComponent.getCurrentComponent(FacesContext.getCurrentInstance());
// ...
}
By the way, the very same construct should work just fine with JSF2's own . I do not see any reason to use here. It would however be the only way if you were actually using a PrimeFaces component such as .
Unrelated to the concrete problem, the event="change" is the default already. You can just omit it.