1

I have a problem with page rendering after migration from WAS 6.0 + JSF 1.1 to WAS 7.0 + JSF 1.2. The main problem is in the following code:

<h:messages rendered="#{!webData.facesMessagesEmpty}" styleClass="messages"
showSummary="true" showDetail="false" title="Messages" layout="table" id="eMessages"
infoClass="info_with_icon" warnClass="warn_with_icon" errorClass="error_with_icon"
fatalClass="fatal_with_icon" />

This code works correctly under WAS 6.0 + JSF 1.1 but doesn’t use styles under WAS 7.0 + JSF 1.2. I have made a little investigation and found that this problem is only for layout="table". If I use layout="list" then styles are ok. Unfortunately I need table here (because layout="list" creates indent, and I don't how to aviod this). Also I have found that generated HTML code in case of layout="table" is very different for JSF 1.1 and JSF 1.2.

So my question - is it possible to force old-style (JSF 1.1) HTML generation for WAS 7.0 + JSF 1.2? I tried to google it but can’t find answer...

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • AFAIK there should be no difference in the generated HTML output. Can you please show relevant portions of the generated HTML output for both JSF 1.x versions which is causing the problem? As to using list, the indent and bullets are easily removeable by a little bit of CSS. Is this solution also acceptable? – BalusC Dec 06 '11 at 13:25
  • JSF 1.1 generated this code: `
    Number of TP found is: 0
    ` JSF 1.2 `
    • Number of TP found is: 0
    ` when I used list layout (table layout for some reason did not take styles, so I can't use it).
    – user1083508 Dec 06 '11 at 13:43
  • CSS class: -.info_with_icon_messages { - -moz-background-clip: border; -moz-background-origin: padding; -moz-background-size: auto auto; background-attachment: scroll; background-color: transparent; background-position: 0 0; background-repeat: no-repeat; color: blue; float: none; list-style-image: none; list-style-position: outside; list-style-type: none; text-indent: 15px; } So no bullets in 2nd style, but I still see indents. Is there any way to have no indents? – user1083508 Dec 06 '11 at 13:43
  • I was more asking for differences in table layout. Please edit your question to show generated HTML of both JSF 1.1 and 1.2 in case of `layout="table"`. – BalusC Dec 06 '11 at 13:50
  • Hi BalusC, once again: JSF1.1 `
    Number of TP found is: 0
    ` JSF1.2 (with table layout this time) `
    Number of TP found is: 0
    ` As I understand, can not have class attribute, my browser do not show any style from 'info_with_icon_messages' in this case.
    – user1083508 Dec 06 '11 at 14:44
  • `` definitely supports the `class` attribute. Your problem is most likely in the CSS side. I posted an answer. – BalusC Dec 06 '11 at 14:53

1 Answers1

1

In a nutshell, JSF 1.1 will put the infoClass and consorts on a <span> inside the <td>, but JSF 1.2 will put it on the <tr>.

It look like that you're using very specific CSS properties which are not supported on the <tr> element. In that case, you've basically 2 options:

  1. Change the CSS declaration to apply it on <td> instead.

    .info_with_icon_messages td {
        /* ... */
    }
    
  2. Change the <h:messages> layout to be a list and add the following CSS properties on the class of the generated <ul>, in your case .messages, to remove the bullets and indent:

    .messages {
        list-style-type: none;
        margin: 0; 
        /* ... */
    }
    
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555