In the PrimeFaces (4.0) confirmation dialog, how can I make sure that No is in focus by default?

As you can see from the image below, the yes button gets the main focus. Can you make sure that No is in focus without swapping buttons around, possibly with an attribute?

enter image description here

+6
source share
1 answer

As far as I know, the only way is to change the buttons in xhtml. But you can keep the order of appearance in the float:left dialog box on the Yes button.

 <p:confirmDialog global="true" showEffect="fade" hideEffect="fade"> <p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" /> <p:commandButton value="Yes" type="button" style="float:left;" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" /> </p:confirmDialog> 
+1
source

Source: https://habr.com/ru/post/985735/


All Articles