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.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.8, 2.1.2
    • Component/s: JSR-314
    • Labels:
      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?).

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Leonardo Uribe
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development