-
1. a4j:htmlCommandLink dynamic id not working
nbelaevski Mar 22, 2011 10:22 AM (in response to stefanorg)Hi,
How does 'item' is defined on the page?
-
2. a4j:htmlCommandLink dynamic id not working
stefanorg Mar 22, 2011 10:35 AM (in response to nbelaevski)Hi Nick,
'item' is the var attribute of a rich:dataTable, i've my own component that wraps a rich:dataTable:
<link:dataTable id="superList"
value="#{utentiDM}"
headerText="Lista Utenti"
showSelectAll="true"
selectionMapTarget="#{utentiBean.selectedIds[item]}"
mBean="#{utentiBean}">
<rich:column>
<f:facet name="header">
<h:outputText value="Username" />
</f:facet>
<a4j:htmlCommandLink action="editUser">
<f:setPropertyActionListener value="#{item.id}" target="#{utentiBean.id}"/>
<h:outputText value="#{item.username}"/>
</a4j:htmlCommandLink>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Soggetti Associati" />
</f:facet>
<a4j:htmlCommandLink action="editUser">
<f:setPropertyActionListener value="#{item.id}" target="#{utentiBean.id}"/>
<h:outputText id="sizeSoggetti" value="Visualizza (#{item.sizeSoggetti})" rendered="#{item.sizeSoggetti>0}" />
<rich:toolTip value="#{item.nomiSoggettiAssociati}" for="sizeSoggetti" rendered="#{item.sizeSoggetti>0}"/>
</a4j:htmlCommandLink>
</rich:column>
<ui:define name="buttons">
<h:commandButton styleClass="icon-add" value="Aggiungi Nuovo" action="editUser"/>
</ui:define>
</link:dataTable>
where link:dataTable inside is:
<rich:dataTable
value="#{value}"
var="item"
rows="#{rowsToDisplay}"
id="#{id}_tbl"
onRowMouseOver="activeRow(this)"
rowClasses="even,odd"
width="#{width}">
....
....
...
-
3. a4j:htmlCommandLink dynamic id not working
nbelaevski Mar 22, 2011 10:44 AM (in response to stefanorg)It doesn't work that way - component tree is built and id is assigned *before* collection is iterated over.
-
4. a4j:htmlCommandLink dynamic id not working
stefanorg Mar 22, 2011 10:50 AM (in response to nbelaevski)so it's not possible to use a value from the collection to build the id? If you would like to create an id depending on some value of your collection, there is a way to do that?
-
5. a4j:htmlCommandLink dynamic id not working
nbelaevski Mar 22, 2011 10:57 AM (in response to stefanorg)Generally no, check this article that describes the related problem: http://www.ilikespam.com/blog/c:foreach-vs-ui:repeat-in-facelets
-
6. a4j:htmlCommandLink dynamic id not working
stefanorg Mar 22, 2011 11:11 AM (in response to nbelaevski)ok thanks!!