Newline in <p:confirm message>

qxlab picture qxlab · Dec 4, 2013 · Viewed 17.7k times · Source

Is there a way to put a new line in the message of <p:confirm> component?

<p:confirm header="Confirmation"  
    message="Are you sure you want to continue? Bla bla bla" 
    icon="ui-icon-alert"  />

I would like to have "Bla bla bla" in a new line.

Answer

Web Devie picture Web Devie · Dec 4, 2013

Message is HTML part, so you need to add <br>. Either take message from bean (to prevent xml tag escaping) or use facet:

<p:confirmDialog header="Confirmation">
    <f:facet name="message">
        Are you sure you want to continue?<br/>Yes or no?
    </f:facet>
</p:confirmDialog>