pretty:link and it's children within composite component

Splash Forums PrettyFaces Users pretty:link and it's children within composite component

This topic contains 5 replies, has 2 voices, and was last updated by  Christian Kaltepoth 6 years, 4 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #17963

    0swald
    Participant

    Hi all.

    I’m not sure whether it’s a bug or not, but here’s what I’ve found:

    Here is a starting working example – product link:

    <prety:link mappingId="product">
    <f:param value="#{product.category}"/>
    <f:param value="#{product.id}"/>
    <!-- more params here -->
    <h:outputText value="Link name"/>
    </prety:link>

    Now I create composite component <test:productLink/> to simplify my code and avoid multiple inclusions of pretty big pretty links.

    <composite:interface>
    <composite:attribute name="product" required="true" type="com.Product"/>
    </composite:interface>

    <composite:implementation>
    <prety:link mappingId="product">
    <f:param value="#{cc.attrs.product.category}"/>
    <f:param value="#{cc.attrs.product.id}"/>
    <!-- more params here -->
    <composite:insertChildren/>
    </prety:link>
    </composite:implementation>

    And use it that way:

    <test:productLink product="#{mybean.product}">
    <h:outputText value="Link name"/>
    </test:productLink>

    I’m using this approach in many components but it fails when it comes to pretty:link. It simply does not insert component’s children via <composite:insertChildren/>. Is it a bug or feature or what?

    Please help.

    #21060

    Hmmm, I don’t see any reason why this should not work with <pretty:link>. Which JSF implementation (and version) are you using?

    #21061

    0swald
    Participant

    Christian, I’m using Mojarra 2.1.0 (FCS 2.1.0-b11), server – glassfish 3.1.

    #21062

    Hmmm! Maybe a Mojarra bug? I doubt that it is a problem with PrettyFaces as the link component doesn’t know anything about composite components.

    You could try if this bug is reproducible with other components that accept <f:param> tags as child components. Perhaps you could try to use <h:link> instead of <pretty:link> in the same composite component. It would be interesting to see if <h:link> works correctly if it gets <f:param> child components via <composite:insertChildren/>.

    #21063

    0swald
    Participant

    Christian, you’re right, it’s not a prettyfaces bug. Restarting server solved the “issue”.

    #21064

    OK! I’m glad to hear it is working now for you! :)

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

Comments are closed.