DefaultCommand does not work without form

UI Components for JSF
Post Reply
trung.do
Posts: 9
Joined: 17 Jul 2017, 05:06

17 Jul 2017, 05:19

hi Primefaces
I'm using pf 5.3, i'm using default command component to handle user bahaviour when user hit enter key button. My requirement is user must hit to a positive button (like Next/Yes/OK/...) in that case. it work fine with normal form but not for dialog with no form or input.
That's dialog that just show one message with two button yes/no. user hit yes we just hide that dialog so which mean no need server-side dialog here.
Any suggestion for this case?
Thanks

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

17 Jul 2017, 10:11

Yep, thats true.
Check line 20 here: https://github.com/primefaces/primeface ... command.js

We can probably make it configurable to allow configuration of the container. e.g.:

Default:

Code: Select all

<p:defaultCommand container="@form" />

Your dialog:

Code: Select all

<p:defaultCommand container="myDialog" />
Feel free to create a feature request.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

trung.do
Posts: 9
Joined: 17 Jul 2017, 05:06

18 Jul 2017, 05:04

Thanks @tandraschko
For moment i will overwrite that feature on Primefaces
Another thing, why we have to focus on input in order to use Enter key (by DefaultCommand), if i just open the page and press enter, notthing happen. I've tested on Chrome (latest).

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 42 guests