Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Formatting error message

 
Ganesh Rangan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i am using <h:messages id="errorMessages" /> to display errors.
in Java side i am adding errors like this

String msg = "hello this is an error";
FacesContext.getCurrentInstance().addMessage("errorMessages", new FacesContext(FacesMessage.SEVERITY_ERROR, msg, msg));

It works but when i add more than 1 error message it all gets displyed in a single line.
i tried using \n and <BR> in msg. nothing works out.

Any help to format the error message and to show them after each line would be appreciated.

Thanks,
gR
 
Akash Singla
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the Tag API,

i think you can define the layout of messages .

Akash
TheDaedals
 
Tim Holloway
Bartender
Posts: 18419
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The messages tag supports 2 types of layout: as list items and as table rows, depending on what tag attributes you declare. You can then use CSS to further control how items look.
 
Ganesh Rangan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the replies.
The layout option 'table' works!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!