Hey everybody,
I got a question concerning the collapsible Panel Tag of MyFaces. I
have several objects inside a database and I added the
"toggleCollapsed" boolean Attribute to the bean.
So that's what the Comments Bean looks like. Just a few getters and
setters, filled by hibernate. Hibernate doesn't touch the property for
the panel.
BUT: When I expand the panel, all of the objects expand and not only
the one I selected. To get this straight: the datatable iterates the
objects inside the list. So each object has a different
"toggleCollapsed" property.
Why does the panel expand all the objects? Here's a screenshot of both
states and the source of the JSF Code.
I'd be glad if anybody could help me with that.
If I am not rebuilding, you can check it out for yourself:
http://82.207.147.13:8080/Produktredaktion/pages/kommentare.xhtml
Thanks in advance,
Andreas
<t:dataTable
id="kommentare"
value="#{benutzerKommentare.comments}"
var="comments"
rows="15"
rowClasses="oddRow, evenRow"
renderedIfEmpty="true"
headerClass="tableHeader"
preserveDataModel="false"
>
<t:column>
<f:facet name="header">
<h:outputText value="ID" />
</f:facet>
<t:outputText value="#{
comments.id}"
/>
</t:column>
<t:column width="30">
<f:facet name="header">
<h:outputText value="Kommentar" />
</f:facet>
<t:outputText
value="#{comments.kommentar}" />
</t:column>
<t:column width="30">
<f:facet name="header">
<h:outputText value="Benutzername"
/>
</f:facet>
<t:outputText
value="#{comments.benutzer.vorname} #{comments.benutzer.nachname}" />
</t:column>
<t:column>
<f:facet name="header">
<h:outputText value="" />
</f:facet>
<t:collapsiblePanel
value="antworten" collapsed="#{comments.toggleCollapsed}"
var="#{collapsed}" >
<h:inputText
value="#{comments.reaktion}" rendered="#{!collapsed}"/>
</t:collapsiblePanel>
</t:column>
</t:dataTable>