title: PrimeFaces panel inside a jstl <c:forEach loop is keeping the previous index of the collapsed panel on updating the panel from an external link
body: <p>I have a web page which contains a list of panels inside a jstl forEach loop. All panels are collapsed on loading the page. On expanding each panel i'm saving the collapsed state to the bean in order to refer it later. Im updating the the panel from a p:commandLink, but panels are shown expanded based on the previous index , not on the bean value. My requirement is the panel's collapsed property should get updated according to the bean value set previously, at present the panels are getting expanded according the index of the previously expanded panels, not according to it's bean property value.</p>
  
  <p>Just take a look at the code snippet.</p>
  
  <pre><code>&lt;h:form id="form"&gt;
          &lt;c:forEach items="#{items}" var="name"&gt;
              &lt;p:panel header="#{name}" toggleable="true"
                  toggleTitle="#{bean.toggleStatus.get(name)}"
                  collapsed="#{bean.toggleStatus.get(name)}" toggleSpeed="500"
                  id="panel#{name}" widgetVar="panel#{name}"&gt;
                  &lt;h:outputText value="#{name}"/&gt;
              &lt;/p:panel&gt;
          &lt;/c:forEach&gt;
          &lt;p:commandLink id="Search" style="margin-left :5px;"
              action="#{bean.search}" update="form" ajax="true"/&gt;
      &lt;/h:form&gt;
  </code></pre>