Skip to main content

binding attribute inside ui:repeat doesn't work

No replies
devinderpal
Offline
Joined: 2011-02-14
Points: 0

I have searched enough on this topic and haven't found anything..
Can someone please give their suggestion. It seems like a problem that need to solve frequently.
I need to create dynamic component inside ui:repeat and it doesn't work. See below code:

<ui:repeat var="c" value="#{mybean.list}">
<h:outputLabel value="#{c.displayName}"/>
<h:panelGroup binding=#{c.myComponent}/>
</ui:repeat>

mybean.list returns list of object which has getMyComponent method to return UIComponent.
But this always throw error saying
"binding="#{c.myComponent}": Target Unreachable, identifier 'c' resolved to null".
If I remove line with binding in it, everything works fine and displayName is displayed. So no problem with the loop.

Please suggest how to resolve it.