Details

    • Type: Sub-task Sub-task
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.1
    • Fix Version/s: None
    • Component/s: Facelets/VDL
    • Labels:
      None
    • Status Whiteboard:
      Hide

      size_medium importance_medium

      Show
      size_medium importance_medium

      Description

      Currently there is no way to find out (except from ugly and/or implementation-specific hacks) to find out if a user provided content for a <ui:insert name="xxx"/> or not.

      Scenario: Imagine you want to provide an optional search form, which the user can define via <ui:define name="searchForm">. Then you can insert it via <ui:insert name="searchForm" />. However, what if you have to render some additional markup around the user provided search form, but you don't want to render it if the user did not provide a search form?

      One very ugly workaround is to use a h:panelGroup, which you bind to a bean, use <ui:insert name="searchForm" /> as the only child and check via the binding if the h:panelGroup has any children.

      It would be very nice to have an EL expression to check this stuff, or maybe to have a special facelets tag which only renders its content if a specific template is available, e.g. (note that I am not very good with names) <ui:ifTemplateAvailable name="">....<ui:insert name="xxx" /> ...</ui:...>

      From the MyFaces-impl point of view, I think it is not very hard to implement.

        Activity

        Jakob Korherr created issue -
        Hide
        Jakob Korherr added a comment -

        or <ui:ifDefined name="xxx">...</ui:ifDefined>

        Show
        Jakob Korherr added a comment - or <ui:ifDefined name="xxx">...</ui:ifDefined>
        Ed Burns made changes -
        Field Original Value New Value
        Status Whiteboard size_medium importance_medium
        Ed Burns made changes -
        Parent JAVASERVERFACES_SPEC_PUBLIC-717 [ 20322 ]
        Issue Type Improvement [ 4 ] Sub-task [ 5 ]
        Ed Burns made changes -
        Assignee Ed Burns [ edburns ]
        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.
        Ed Burns made changes -
        Priority Major [ 3 ] Trivial [ 5 ]
        Manfred Riem made changes -
        Priority Trivial [ 5 ] Minor [ 4 ]
        Hide
        Manfred Riem added a comment -

        Setting priority to Minor

        Show
        Manfred Riem added a comment - Setting priority to Minor

          People

          • Assignee:
            Unassigned
            Reporter:
            Jakob Korherr
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: