I am trying to make the bootstrap collapse(accordion) according to the last example in this page.
http://www.w3schools.com/Bootstrap/bootstrap_collapse.asp
Now in this example, the number of divs are hard coded, 3 in this case. I want to make the same based on the number of values in a JAVA Set .
From my knowledge, i am trying to use ui:repeat like this
<ui:repeat value="#{myBean.apples}" var="apples">
</ui:repeat>
where apples is a set(unique list) of integers.
Here is the complete code:
<h:panelGroup layout="block"
rendered="#{researcherQueriesDetailBean.offerPersonDTO.size() > 0}">
<div class="panel-group" id="accordion" role="tablist"
aria-multiselectable="true">
<ui:repeat value="#{researcherQueriesDetailBean.offerMakers}"
var="offerMakers">
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<a role="button" data-toggle="collapse"
data-parent="#accordion" href="#sample-list"
aria-expanded="false" aria-controls="sample-list">
Sample Availability </a>
</h4>
</div>
<div id="sample-list" class="panel-collapse collapse"
role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body"></div>
</div>
</div>
</ui:repeat>
</div>
</h:panelGroup>
I am having trouble in placing the ui:repeat in the code so that the accordion panels are repeated according to the number of elements in the set.Is it even possible to do it this way? Any code reference in this case would be helpful.
Thanks.