I have the following <p:commandLink>
placed inside <p:dataList>
that is placed inside a <ui:repeat>
and then another <ui:repeat>
:
<h:form>
<ui:repeat value="#{myManager.selectedNode.data.children}" var="childdatapanel">
<p:panel header="#{childdatapanel.key}" collapsed="true">
<ui:repeat value="#{childdatapanel.value}" var="childdata">
<h:panelGrid columns="1">
<p:dataList value="#{childdata.value}" var="entity" itemType="disc" type="inset">
<p:column>
<p:commandLink value="#{entity.label}" action="#{myManager.seeDetails(entity)}" styleClass="entity-label"
onclick='alert("#{entity.label}");'>
</p:commandLink>
</p:column>
</p:dataList>
</h:panelGrid>
</ui:repeat>
</p:panel>
</ui:repeat>
</h:form>
The result of this code displays something like this:
childdatapanel.key1
entity1.1
entity1.2
entity1.3
childdatapanel.key2
entity2.1
entity2.2
entity2.3
childdatapanel.key3
entity3.1
entity3.2
entity3.3
childdatapanel.key4
entity4.1
entity4.2
entity4.3
However, although the value of the <commandLink>
is displayed correctly and the alert gets the correct value "onclick", however the object passed to myManager.seeDetails(entity)
in incorrect. If I press "entity1.1" or "entity2.1" or "entity3.1", I allways get "entity4.1" and so forth.
Any ideea what am I doing wrong? I'm using primefaces 3.4 and primefaces-mobile 1.0 snapshot.