I'm trying to create accordionPanel in Primefaces.And i'm trying to create that using ui:repeat
so i can create panel tabs dynamically.But somehow my code doesn't works, accordionPanel is empty and does not have any tabs.can any one give me the reason or point me how to achieve this.
here my bean.
@ManagedBean(name = "divisionList")
public class Divisions implements Serializable {
private List<String> divStrings;
public List<String> getDivStrings() {
return divStrings;
}
public Divisions(){
divStrings=new ArrayList<String>();
divStrings.add("Division A") ;
divStrings.add("Division B");
}
}
and in my xhtml :
<p:accordionPanel >
<ui:repeat value="#{divisionList.divStrings}" var="divis">
<p:tab title="#{divis}">
Content
</p:tab>
</ui:repeat>
</p:accordionPanel>
EDIT:
But when it print like this its working :O
<ui:repeat value="#{divisionList.divStrings}" var="divis">
<h:outputText value="#{divis}" />
</ui:repeat>
There is no problem with your ui:repeat, don't wrap it inside an empty
<p:accordionPanel >
Or remove the uirepeat and fill in the value of your accordionPanel
Do like this
<p:accordionPanel value="#{test.divStrings}" var="divis" >
<p:tab title="#{divis}">
Content
</p:tab>
</p:accordionPanel>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With