Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Primefaces inputtext triggers commandbutton issue

I have an easy question.

I have few primefaces inputtext and two primefaces commandbutton on my xhtml page. When I press enter after edited the inputtext, it triggers one of my commandbutton.

But I want to trigger the other commandbutton. How to do that? And how it decide which commandbutton is to be triggered? What is the reason there?

Thanks for help.

like image 952
rLyLmZ Avatar asked Jan 17 '26 02:01

rLyLmZ


1 Answers

You can use p:defaultCommand

<p:defaultCommand target="btnId" />
like image 111
Hatem Alimam Avatar answered Jan 19 '26 18:01

Hatem Alimam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!