So I have an inputText
that has its value hook to myBean.text
, I want that if I click enter/return key, the inputText will invoke a method inside
As per your question history, I know that you're using JSF 2.0, so here's a JSF 2.0 targeted answer: use
which listens on a change
event and use keypress
event to invoke it when the enter key is pressed (keycode 13).
The #{bean.listener}
should point to a method like
public void listener(AjaxBehaviorEvent event) {
// ...
}