3 Replies Latest reply on Aug 6, 2009 2:23 PM by Julien Kronegg

    s:link and s:button action problem with ui:include

    Jarek Gilewski Newbie


      I have something like this in my xhtml page:

                <ui:include src="layout/remove.xhtml">
                     <ui:param name="entityHome" value="#{componentHome}" />

      In remove.xhtml I have:

      <s:link value="#{messages['yes']}" action="#{entityHome.remove}" />
          <h:commandLink value="#{messages['yes']}" action="#{entityHome.remove}" /

      The link from s:link looks like:


      and from h:commandLink


      In the s:link there is entityHome.remove instead of componentHome.remove and the link does not work. If i change the link manually it is ok.

      h:commandLink works ok.

      It was tested on SEAM 2.1.1.GA

      Is'nt it a bug? Should I make a JIRA issue?



        • 2. Re: s:link and s:button action problem with ui:include
          Daniel Bernstein Newbie

          I'm having exactly the same problem. Have you found a resolution?

          • 3. Re: s:link and s:button action problem with ui:include
            Julien Kronegg Novice

            I had the same problem with s:button. BTW, this is a Seam issue JBSEAM-666 (also occurs on Seam 2.1.2).

            I solved it by using two ui:include and without using ui:param. The structure is as follow:

            In main.xhtml:

            <ui:include src="layout/removeForComponentHome.xhtml"/>

            In removeForComponentHome.xhtml:

                <ui:include src="layout/remove.xhtml"/>
                <div id="actionButtons">
                    <s:link value="#{messages['yes']}" action="#{componentHome.remove}" />
                    <h:commandLink value="#{messages['yes']}" action="#{componentHome.remove}" /

            In remove.xhtml:

            ... <!-- The fields without action buttons -->

            If I want the remove.xhtml file with action buttons referring another entity home (let's say #{anotherHome}), I'm using another intermediate include file removeForAnotherHome.xhtml:

                <ui:include src="layout/remove.xhtml"/>
                <div id="actionButtons">
                    <s:link value="#{messages['yes']}" action="#{anotherHome.remove}" />
                    <h:commandLink value="#{messages['yes']}" action="#{anotherHome.remove}" /

            This is not perfect because the action button code is duplicated, but at least I could factorize remove.xhtml fields.