Environment (JDeveloper 11.1.2.0.0, ADF Faces)
In the last post, I have explained how to show af:message programatically. In some cases the user may need to show a multi-lines message, in this post I will explain how to do this.
af:message allows us to include a formatted text in the message, this can be done by surrounding the message text with <html> tags. So to show a multi-lines message, we can use <p> tag in our message text. The method below displays three lines message.
public String shwoMultiLinesMessage() {
StringBuilder builder = new StringBuilder(“<html> <body>”);
builder.append(“<p>First Line</p>”);
builder.append(“<p>Second Line</p>”);
builder.append(“<p>Third Line</p> “);
builder.append(“</body> </html>”);
FacesMessage fm = new FacesMessage(builder.toString());
fm.setSeverity(FacesMessage.SEVERITY_INFO);
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, fm);
return null;
}
The result is af:message with three lines as shown in the image below:



How to set height and width of af:messages window?
It do not auto re-size unlike dialog box?
Unfortunately I have no idea about that.
This question has been discussed in OTN by Chris Muir who is an Oracle ADF Product Manager.
https://forums.oracle.com/forums/thread.jspa?threadID=1060363
but it seems there is no answer until now.
It is better to re ask the question in Jdeveloper and ADF forum
https://forums.oracle.com/forums/forum.jspa?forumID=83
good luck there.