1

I have the following composite component:

<!-- INTERFACE -->
<cc:interface>
</cc:interface>

<!-- IMPLEMENTATION -->
<cc:implementation>
    <h:outputText id="noidhere_#{cc.id}" value="#{cc.id}" />
    <br />
</cc:implementation>

And it's usage:

<!-- Here works fine -->
<custom:example id="staticId" /> 
<ui:repeat varStatus="status" value="#{sampleBean.values}" var="val">
     <!-- but here doesn't -->
     <custom:example id="#{status.index}" /> :::: #{status.index}
</ui:repeat>

In this case the output will be the following:

staticId 
test_ :::: 0 
test_ :::: 1

As you can see, the composite component doesn't get rendered with the passed id attribute. My expected output would be something like this:

staticId 
test_0 :::: 0 
test_1 :::: 1

I also tried to use the val attribute to check if it is a problem with the status.index itself, but I had the same problem.

It was tested using Mojarra 2.2.7 Am I missing something, or is it a bug ?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Josh
  • 154
  • 1
  • 9
  • 1
    It's not a matter of composite component, it's a matter of availability of the EL variable during view build time which is required for the 'id' attribute. This question has already been answered [here](http://stackoverflow.com/questions/18358604/how-to-use-el-with-uirepeat-var-in-id-attribute-of-a-jsf-component) – Zim Jun 14 '15 at 20:16
  • @Zim Thank you for pointing it out, I will mark this as duplicated. – Josh Jun 14 '15 at 20:42

0 Answers0