Confirm with ConfirmDialog and escaped message
Posted: 14 Nov 2017, 16:04
Hey guys,
I have here a confirm action that calls a confirmDialog setted with global=true And I wanted to show the formatted message so I discovered that there is a facet to that, my problem is when the message comes from a p:confirm, how do I get the message?
This is my button with the confirm component
This is my genericModal:
In my messagesBundle my propertie is like this:
The "jsfUtil.getBundledMessage" will get the bundle passing through the parameter.
The issue here is how I properly use the facet so I can show a escaped message, something like this:
I found this open issue here (https://github.com/primefaces/primefaces/issues/60) from 2015 but nothing more to it
Thanks.
I have here a confirm action that calls a confirmDialog setted with global=true And I wanted to show the formatted message so I discovered that there is a facet to that, my problem is when the message comes from a p:confirm, how do I get the message?
This is my button with the confirm component
Code: Select all
<p:commandButton id="btToTest"
action="#{myBean.doSomething}"
value="#{messagesBundle['switch.off']}">
<p:confirm header="#{messagesBundle['modalgenericconfirm.header']}"
message="#{jsfUtil.getBundledMessage('test.remove_message', varDataTable.name)}"/>
</p:commandButton>
Code: Select all
<p:confirmDialog id="genericDialogConfirm" global="true" showEffect="fade" hideEffect="fade" style="width:350px !important;" closable="false"
widgetVar="wvDialogConfirm">
<div align="center">
<p:commandButton value="#{messagesBundle['button.cancel']}"
type="button"
styleClass="ui-confirmdialog-no ui-button redRoman-button"
icon="fa fa-close"/>
<p:commandButton value="#{messagesBundle['button.confirm']}"
type="button"
styleClass="ui-confirmdialog-yes ui-button light-green-button"
icon="fa fa-check"/>
</div>
</p:confirmDialog>
Code: Select all
test.remove_message = You will remove <b>"{0}"</b>. Do you want to continue?
The issue here is how I properly use the facet so I can show a escaped message, something like this:
Code: Select all
<p:confirmDialog id="genericDialogConfirm" global="true" showEffect="fade" hideEffect="fade" style="width:350px !important;" closable="false"
widgetVar="wvDialogConfirm">
<f:facet name="message">
<h:outputText value="HOW TO GET THE MESSAGE FROM P:CONFIRM HERE???" escape="false"/>
</f:facet>
.... buttons
</p:confirmDialog>
Thanks.