javaserverfaces-spec-public
  1. javaserverfaces-spec-public
  2. JAVASERVERFACES_SPEC_PUBLIC-631

Specify target facet name when inserting into composite component

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Uncategorized
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Macintosh

    • Issuezilla Id:
      631
    • Status Whiteboard:
      Hide

      size_medium importance_medium

      Show
      size_medium importance_medium
    • Tags:

      Description

      As discussed on jsr-314-open...

      As currently specified, composite:insertFacet's "name" attribute serves two purposes:

      1. It identifies the name of the facet on the containing composite component to insert.
      2. It identifies the name of the facet on the target component into which the facet is being inserted.

      As a result, the name of the facet exposed by the composite component must match the name of the
      facet on the implementation component into which the facet is being inserted. So, for example, if I
      have a composite component as follows:

      <composite:interface>
      <composite:facet name="caption"/>
      </composite:interface>

      <composite:implementation>
      <h:panelGrid>
      <composite:insertFacet name="caption"/>
      </h:panelGrid>
      </composite:implementation>

      Everything is happy, since both the composite component and the h:panelGrid expose a "caption" facet.

      However, if I want to define a composite component with two h:panelGrid components and two
      captions:

      <composite:interface>
      <composite:facet name="caption"/>
      <composite:facet name="backupCaption"/>
      </composite:interface>

      <composite:implementation>
      <h:panelGrid>
      <composite:insertFacet name="caption"/>
      </h:panelGrid>

      <h:panelGrid>
      <!-- Uh oh. -->
      <composite:insertFacet name="backupCaption"/>
      </h:panelGrid>
      </composite:implementation>

      I am out of luck, since I now have a mismatch between the composite component facet name and the
      h:panelGrid facet name.

      I think that we could/should solve this in one of two ways:

      1. Add an attribute to composite:insertFacet that allows a target facet name to be specified:

      <h:panelGrid>
      <composite:insertFacet name="backupCaption" targetName="caption"/>
      </h:panelGrid>

      2. Specify that the target facet name can be picked up from a wrapping <f:facet> tag:

      <h:panelGrid>
      <f:facet name="caption">
      <composite:insertFacet name="backupCaption"/>
      </f:facet>
      </h:panelGrid>

      1. 631-cc-insertFacet-targetName.patch
        2 kB
        lu4242

        Activity

        Hide
        lu4242 added a comment -

        Created an attachment (id=324)
        Test demo using maven. To run type: mvn clean -Djsf=mojarra jetty:run

        Show
        lu4242 added a comment - Created an attachment (id=324) Test demo using maven. To run type: mvn clean -Djsf=mojarra jetty:run
        Hide
        rogerk added a comment -

        triage

        Show
        rogerk added a comment - triage
        Hide
        Jakob Korherr added a comment -

        IMHO it should be targeted for 2.1

        Show
        Jakob Korherr added a comment - IMHO it should be targeted for 2.1
        Hide
        Ed Burns added a comment -

        Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

        Show
        Ed Burns added a comment - Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.
        Hide
        Manfred Riem added a comment -

        Setting priority to Major

        Show
        Manfred Riem added a comment - Setting priority to Major

          People

          • Assignee:
            Unassigned
            Reporter:
            aschwart
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: