Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-3287

h:outputStylesheet and h:outputScript with inner markup and references to #{cc} cannot found the parent component.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0.8, 2.1.2
    • JSR-314
    • None

    Description

      Look this example:

      <composite:interface>
      <composite:attribute name="style"/>
      </composite:interface>
      <composite:implementation>
      <h:outputStylesheet rendered="#

      {!empty cc.attrs.style}

      "><![CDATA[
      .myCustomStyle { #

      {cc.attrs.style}

      }
      ]]></h:outputStylesheet>
      </composite:implementation>

      h:outputStylesheet definitions are always relocated to <head>, so this fragment of code just does not work, but it is valid.

      After doing a lot of tests I realize that we can create a "find component expression" and save it on h:outputStylesheet as an attribute, and use it later to locate the right instance in the component tree.

      If the component is inside a datatable, it will get the component state without row, which has the effect to makes the related properties not changeable inside a datatable. It has sense after all because this use case of h:outputStylesheet is to add an style declaration per component added to a page, and not to render inline row (for that use <style> instead, right?).

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            lu4242 Leonardo Uribe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: