Search code examples
jsfmessagetomahawk

JSF t:messages - How to avoid tables?


I got JSF Tomahawk messages and those messages got rendered as one HTML-Table. How do I avoid such tables? I would prefer one div for all messages which contains one paragraph for each message. Thanks in advance.

My JSF-file-snippet:

<t:messages layout="table" replaceIdWithLabel="true" showDetail="true" showSummary="false" styleClass="mycustomclasswhichgrabsthisshit" />

Solution

  • Check the Tomahawk tag documentation. The <t:messages> tag documentation says the following:

     Name   | Type   | Supports EL? | Description
     -------+--------+--------------+---------------------------------------------
     layout | String | Yes          | The layout: "table" or "list". Default: list
    

    So, fix it accordingly:

    <t:messages layout="list" ... />
    

    Or just remove it altogether. It's the default already.

    You can if necessary remove the list bullets using CSS:

    .mycustomclasswhichgrabsthisshit {
        list-style-type: none;
    }
    

    (disclaimer: the ranty classname is literally copied from your example, it's not mine)