javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2233

dataTable captionClass attribute is ignored for caption facet

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Invalid
    • Affects Version/s: 2.1.3
    • Fix Version/s: None
    • Component/s: facelets
    • Labels:
      None

      Description

      The API doc for h:dataTable says,

      'Render the "caption" facet, if present, inside a "caption" element immediately below the "table" element. If the "captionClass" attribute is specified, render its value as the value of the "class" attribute on the "caption" element.'

      If I specify the captionClass attribute in an h:dataTable tag and use f:facet with name="caption", the values specified for the style in the stylesheet seem to be ignored (font-weight, font-size, color, etc.).

      <h:dataTable id="items"
      captionClass="list-caption"
      ...

      The values are also ignored if I specify the styleClass attribute in the outputText tag:

      <f:facet name="caption">
      <h:outputText styleClass="list-caption" value="#

      {bundle.Caption}"/>
      </f:facet>

      The only ways to specify a style for the caption are to use the captionStyle attribute in the h:dataTable tag –

      <h:dataTable id="items"
      captionStyle="font-weight:bold"
      ...

      or to use the style attribute in the outputText tag:

      <h:outputText style="font-weight: bold" value="#{bundle.Caption}

      "/>

      Is this a bug or a feature? Attributes for other kinds of stylesheet classes are interpreted correctly –

      <h:dataTable id="items"
      captionStyle="font-weight:bold"
      columnClasses="list-column-center, list-column-left,
      list-column-right, list-column-center"
      footerClass="list-footer"
      headerClass="list-header"
      rowClasses="list-row-odd, list-row-even"
      styleClass="list-background"
      ...

      I'm using Java EE 6 SDK Update 3 (GF 3.1.1) with JDK 6u27.

      1. bookshowcart.xhtml
        5 kB
        Kim Haase
      2. stylesheet.css
        2 kB
        Kim Haase

        Activity

        Hide
        Manfred Riem added a comment -

        Can you verify if this is still an issue with the latest 2.1 release?

        Show
        Manfred Riem added a comment - Can you verify if this is still an issue with the latest 2.1 release?
        Hide
        Manfred Riem added a comment -

        Lowering priority because of no response

        Show
        Manfred Riem added a comment - Lowering priority because of no response
        Hide
        Kim Haase added a comment -

        My apologies – I missed this comment.

        I guess you can close the bug, because JSF appears to do what the API doc for h:dataTable says:

        Render the "caption" facet, if present, inside a "caption" element immediately below the "table" element. If the "captionClass" attribute is specified, render its value as the value of the "class" attribute on the "caption" element. If I specify captionClass="list-caption", that is rendered correctly:

        <table id="form:items" class="list-background" border="1" summary="This page lists the books in your shopping cart.">
        <caption class="list-caption">Books in Shopping Cart</caption><thead>
        ...

        It must be a browser problem that the stylesheet values for list-caption are interpreted incorrectly, not a Faces problem.

        Show
        Kim Haase added a comment - My apologies – I missed this comment. I guess you can close the bug, because JSF appears to do what the API doc for h:dataTable says: Render the "caption" facet, if present, inside a "caption" element immediately below the "table" element. If the "captionClass" attribute is specified, render its value as the value of the "class" attribute on the "caption" element. If I specify captionClass="list-caption", that is rendered correctly: <table id="form:items" class="list-background" border="1" summary="This page lists the books in your shopping cart."> <caption class="list-caption">Books in Shopping Cart</caption><thead> ... It must be a browser problem that the stylesheet values for list-caption are interpreted incorrectly, not a Faces problem.
        Hide
        Manfred Riem added a comment -

        Closing as per reporter. Thanks!

        Show
        Manfred Riem added a comment - Closing as per reporter. Thanks!
        Hide
        Kim Haase added a comment -

        Actually, there does seem to be a different problem that may be known, but I am not sure where to file it.

        The stylesheet link in the HTML source for the deployed app points to

        <link type="text/css" rel="stylesheet" href="/dukesbookstore/faces/javax.faces.resource/stylesheet.css?ln=css" />

        I have made several edits to the stylesheet for dukes-bookstore, cleaned and redeployed the app, but every time it uses the original version of the stylesheet, which had an incorrect background-color specification for the list-caption element. I even tried stopping and restarting GlassFish, but it's still using that stylesheet. How do I get rid of it and make GlassFish use the revised one? Where on earth IS it? I can't find it under the GlassFish domain.

        Show
        Kim Haase added a comment - Actually, there does seem to be a different problem that may be known, but I am not sure where to file it. The stylesheet link in the HTML source for the deployed app points to <link type="text/css" rel="stylesheet" href="/dukesbookstore/faces/javax.faces.resource/stylesheet.css?ln=css" /> I have made several edits to the stylesheet for dukes-bookstore, cleaned and redeployed the app, but every time it uses the original version of the stylesheet, which had an incorrect background-color specification for the list-caption element. I even tried stopping and restarting GlassFish, but it's still using that stylesheet. How do I get rid of it and make GlassFish use the revised one? Where on earth IS it? I can't find it under the GlassFish domain.
        Hide
        Manfred Riem added a comment -

        Have you tried clearing your session cookies?

        Show
        Manfred Riem added a comment - Have you tried clearing your session cookies?
        Hide
        Kim Haase added a comment -

        No, but clearing the cache seems to work. Thanks!

        Show
        Kim Haase added a comment - No, but clearing the cache seems to work. Thanks!

          People

          • Assignee:
            Unassigned
            Reporter:
            Kim Haase
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: