Skip to main content
typo
Link
AlanObject
  • 10k
  • 19
  • 94
  • 155

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

edited tags
Link
BalusC
  • 1.1m
  • 377
  • 3.7k
  • 3.6k
Source Link
AlanObject
  • 10k
  • 19
  • 94
  • 155

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

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