0

I am using primefaces 6, JSf2.0, jstl 1.2 on Weblogic server. I have an xhtml page where i want to display panels dynamically inside a Tab. The panels should behave like a Dashboard, so i have put the panels inside a dashboard tag.

My problem is that c:forEach is not able to get values from the items I want to iterate. It is confirmed that my "items="${cg.charts}" is of List type and does have objects, but the panels dont appear in UI, as well as there are not exception raised. Any leads ?

<p:tabView  id="tabViewId"
value="#{userdashboard.chartGroupsList}" var="cg" onTabShow="reflowChart()" >


<p:tab title="#{cg.groupName}" >



    <p:dashboard model="#{userdashboard.model}" >
    <p:ajax event="reorder" listener="#{userdashboard.handleReorder}"  />


    <c:forEach var="c" items="${cg.charts}">


       <p:panel id="pnlDivId#{c.id}" header="#{c.name}">hello</p:panel>





    </c:forEach>

    </p:dashboard>
</p:tab>

</p:tabView>    
ZEE
  • 381
  • 1
  • 6
  • 20
  • 1
    Read [this](http://stackoverflow.com/questions/3342984/jstl-in-jsf2-facelets-makes-sense) first. This is not p:tab related, it is a generic issue. You cannot access variables of jsf tags in jstl tags. – Kukeltje Aug 23 '16 at 12:22
  • if i use ui:repeat, instead of c:forEach, i get a ClassCastException , saying that UI repeat cannot be casted to Panel tag. – ZEE Aug 24 '16 at 06:14
  • can anyone help ? – ZEE Aug 25 '16 at 06:43
  • the dashboard should be defined in the model. Like in the showcase – Kukeltje Aug 25 '16 at 06:51
  • the dashboard in my example is using model. – ZEE Aug 25 '16 at 10:17
  • Sorry, yes, the model in for the dashboard is only for the order, contrary to other components that use a 'model'. – Kukeltje Aug 25 '16 at 10:19
  • @Kukeltje . how can i solve the ClassCastException which is raised when i use ui:repeat ? – ZEE Aug 25 '16 at 10:21
  • 1
    Only by changing the internals of the dashboard. I think you ran into a corner case that is not supported. – Kukeltje Aug 25 '16 at 10:32
  • Thank you. Now i have a clear way to decide. – ZEE Aug 25 '16 at 11:05

0 Answers0