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

Add ability for define tag to append to an existing definition

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Facelets/VDL
    • Labels:
      None

      Description

      In Facelets one can use a ui:define tag to define content in a template client. This named content can be inserted into a template by using ui:insert.

      When the template client that defines the content is itself a template, its template client may also want to contribute to this content, typically by appending to it. This is currently not possible. The template needs to use a new ui:insert tag with a new name.

      E.g.

      template.xml

      <f:view>            
          <ui:insert name="links"/>        
      </f:view>
      

      general.xml

      <ui:composition template="template.xhtml">     
         <ui:define name="links">
               <h:link ... />
               <ui:insert name="links1"/>    
         </ui:define>        
       </ui:composition>
      

      orders.xml

      <ui:composition template="general.xhtml">     
         <ui:define name="links1">
            <h:link ... />
            <ui:insert name="links2"/>     
         </ui:define>        
       </ui:composition>
      

      etc

      Instead of manually 'chaining' defines and inserts in this way, Facelets could define tags or attributes for contributing to existing definitions. E.g.:

      general.xml

      <ui:composition template="template.xhtml">     
         <ui:append name="links">
            <h:link ... />    
         </ui:append>        
       </ui:composition>
      

      orders.xml

      <ui:composition template="general.xhtml">     
         <ui:append name="links">
            <h:link ... />    
         </ui:append>        
       </ui:composition>
      

      Instead of introducing a new ui:append tag, a contribute="append" on ui:define could be used instead. Next to appending, prepending could be considered via a ui:contribute tag or contribute="prepend" attribute.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            arjan tijms
          • Votes:
            6 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated: