Using tr:commandLink in the previous example seems ok, since proper row
keys are used. Don't know why h:commandLink does not work.
However my original example is a bit more complex as a command cell
contains a toolbar, and column set is iterated over by Facelets c:forEach:
<tr:table id="result" var="row" ...
<c:forEach var="column" items="#{bean.columnHeaders}"
varStatus="iteration">
<tr:column>
.....
<h:panelGrid>
<ui:repeat var="spot"
value="#{cx:getToolbar(row, iteration.index)}">
<tr:commandLink immediate="true"
action="#{spot.execute}" disabled="#{spot.disabled}">
<h:graphicImage
value="#{spot.icon}" style="border: 0px" title="#{spot.tooltip}"/>
</tr:commandLink>
</ui:repeat>
</h:panelGrid>
This does not work. CommandLink id of the first row is repeated for all
rows, while ui:repeat is ok in the sense that it appends an index to
every id.
Btw, I was wrong in my previous msg: a progressive id should appear just
because it's the way I generate row keys as returned by getRowKey.
It's just that the first row key is repeated.
I feel I will spend a debugging evening ...
-- Renzo
Adam Winer wrote:
Question: does this happen if you use tr:commandLink?
h:commandLink certainly should work, just trying to
reduce the set of possibilities.
-- Adam
On 6/20/07, Renzo Tomaselli <[EMAIL PROTECTED]> wrote:
Hi, while using a command link in a tr:table cell, the action method
gets multiple events upon icon click, actually as many events as
rendered rows.
Coding is something like:
<tr:table id="result" var="row" ...
<tr:column>
<h:commandLink immediate="true"
action="#{row.execute}">
<h:graphicImage
value="#{sessionBean.map['trash']}" style="border: 0px"/>
</h:commandLink>
From rendered page, I noticed that all links are rendered as:
<a class="OraLink" href="#"
onclick="submitForm('browser',0,{source:'splitty:tabby:result:d6:0:_id159'});return
false;">
<img style="border: 0px none ;"
src="/AxxBrowser/skins/skin1/images/trash.gif"/>
</a>
while (I guess) it should be 0:_id159, 1:_id159, 2:_id159 ...
I guess from debugging that event generation occurs once per row since
component id is repeating, thus event source matches multiple times
(from CommandLinkRenderer.java).
-- Renzo