8

I wants to display the error message like, "The following headers not avail

1.Name
2.Roll no

How can i show this using faces message in jsf?Please help me.

4 Answers4

8

Without implementing a bizarre hack using javascript and css or without implementing your own JSF messages custom component this is not possible.

You will need to create a new FacesMessage for each line.

maple_shaft
  • 10,435
  • 6
  • 46
  • 74
6

Simply set escape="false" on the <p:messages> component in PrimeFaces 3.3+.

Andrew
  • 5,839
  • 1
  • 51
  • 72
0

you can do it using tag. You need to render this outputText on submit event and then display message in . You have to change escape attribute to false and user tag in you message where you need break. So in above case take one, 2.Roll" escape="false" render="your validation"/>

0

Try this one:

new FacesMessage(FacesMessage.SEVERITY_ERROR,
                 "Title",
                 "<html>List:<ul><li> List item 1;</li><li> List item 2;</li><li> List item 3.</li></ul></html>")
vssk
  • 445
  • 3
  • 7