AlanObject
AlanObject

Reputation: 9943

Composite component parameter does not evaluate when it is a ui:repeat var attribute

I have a composite component that takes a specific object type as its value attribute. It looks like this:

<cc:interface>
    <cc:attribute name="value" 
                  type="com.myapp.Tally" 
                  required="true" 
</cc:interface>

The component merely produces a h:panelGrid with data elements from the object.

I have never had trouble with it until I tried using it inside a ui:repeat structure like this:

<ui:repeat value="#{myApp.tallyList}" var="tally">    
  <p>
    <qc:tallySummaryH value="#{tally}" />
  </p>
</ui:repeat>

When this page is requested, it throws an exception:

javax.faces.view.facelets.TagException: /table.xhtml @86,66 <qc:tallySummaryH> The following attribute(s) are required, but no values have been supplied for them: value. 
    at com.sun.faces.facelets.tag.composite.InterfaceHandler.validateComponent(InterfaceHandler.java:233)
    at com.sun.faces.facelets.tag.composite.InterfaceHandler.apply(InterfaceHandler.java:125)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
    at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152)
    at com.sun.faces.facelets.tag.jsf.CompositeComponentTagHandler.applyCompositeComponent(CompositeComponentTagHandler.java:349)

Other references to #{tally} inside the ui:repeat loop do not have any problem. They operate as expected. Is this a Mojarra bug or is there something in the JSF specification I didn't understand?

This is on Mojarra 2.1.0 (FCS 2.1.0-b11) in GlassFish 3.1.1

Upvotes: 1

Views: 980

Answers (1)

BalusC
BalusC

Reputation: 1108642

This is related to a bug which was fixed in Mojarra 2.1.1. Consider upgrading. I believe it's (in)directly the result of the visit hint fixes as mentioned in this overview of issues fixed in Mojarra 2.1.1.

Upvotes: 2

Related Questions