Initial text problem
I have a simple question.
I have few feathers inputtext
and two straight lines commandbutton
in my xhtml page. When I press enter after editing the input text, it runs one of my commands.
But I want to bring up another command menu. How to do it? And how does he decide which one commandbutton
should be launched? What is the reason?
Thanks for the help.
+3
rLyLmZ
source
to share
2 answers
you can use p:defaultCommand
<p:defaultCommand target="btnId" />
+3
Hatem Alimam
source
to share
You can catch the "hit enter event" in JavaScript and simulate a click on a button of your choice.
Something like that:
$('#yourInput').on('keyup', function(e) {
if (e.which == 13) {
$("#yourButton").click();
}
});
+1
Thrax
source
to share