5 Replies Latest reply: Dec 3, 2007 10:20 AM by Martin Sznapka RSS

s:link fragment

Heinz Wilming Newbie

Hello, I try to use s:link with a fragment identifier, but it dosent work.


<s:link fragment="#{var.id}"/>

Have you any idea?

  • 1. Re: s:link fragment
    Pete Muir Master

    the fragment attribute doesn't support EL bindings. If you need it to, please file a feature request in JIRA

  • 2. Re: s:link fragment
    Heinz Wilming Newbie

    How can I dynamically assign IDs?

    For example:

    <h:dataTable var="foo">
    <h:column>
    <a:outputPanel id="#{foo.id}"> ... </a:outputPanel>

    </h:column>
    </h:dataTable>

  • 3. Re: s:link fragment
    Heinz Wilming Newbie

     

    "heinzw" wrote:
    How can I dynamically assign IDs?

    For example:

    <h:dataTable var="foo">
    <h:column>
    <a:outputPanel id="#{foo.id}"> ... </a:outputPanel>

    </h:column>
    </h:dataTable>


    Is there for a another possible solution?

    thx

  • 4. Re: s:link fragment
    Pete Muir Master

    Normally this is not possible due to the JSF lifecycle.

  • 5. Re: s:link fragment
    Martin Sznapka Newbie

    What about to have fragment identifier in pages.xml, I can imagine something like smart help page which gives you the right chapter according to page where you are:

    <page view-id="/*">
     <rule if-outcome="help">
     <redirect view-id="/help.xhtml"/>
     </rule>
    </page>
    
    <page view-id="/applicationOne/*">
     <rule if-outcome="help">
     <redirect view-id="/help.xhtml" fragment="chap_appOne"/>
     </rule>
    </page>
    
    <page view-id="/applicationTwo/*">
     <rule if-outcome="help">
     <redirect view-id="/help.xhtml" fragment="chap_appTwo"/>
     </rule>
    </page>
    


    it will be much easier than dynamically generate s:link's fragment attribute for each xhtml page