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 myBean to do something. Can any one help me?
So I have an inputText that has its value hook to myBean.text , I
Share
As per your question history, I know that you’re using JSF 2.0, so here’s a JSF 2.0 targeted answer: use
<f:ajax>which listens on achangeevent and usekeypressevent to invoke it when the enter key is pressed (keycode 13).The
#{bean.listener}should point to a method like