Hi,
I'am looking for an elegant way to select a row:
I have a request-scope bean named rowNum which is the number of the selected row and I
need
to highlight this row.
By now i have:
<c:set var="currentRow" value="0" />
<c:set var="rowId" value="10" />
<c:set scope="page" var="rowClass" value="selectedRow" />
<display:table align="left" id="row" styleClass="odd" width="100%" name="listBean" >
<c:choose>
<c:when test="${rowId==currentRow}" >
<c:set scope="page" var="rowClass" value="selectedRow" />
</c:when>
<c:otherwise>
<c:set scope="page" var="rowClass" value="normalRow" />
</c:otherwise>
</c:choose>
<display:column class="<%=(pageContext.getAttribute("rowClass")).toString()%>" >
<c:out value="${currentRow}" />
<c:out value="${rowClass}" />
<%=(pageContext.getAttribute("rowClass")).toString()%>
</display:column>
<display:column class="<%=(pageContext.getAttribute("rowClass")).toString()%>"
property="comp_id.trxDate" width="10%" title="Datum"
decorator="com.dataconnect.pms.online.decorator.ShortDateDecorator" />
<display:column property="comp_id.orgNod.orgNodeApplId" width="20%" title="Id" />
<display:column property="comp_id.orgNod.shortDescription" width="10%"
title="Bezeichnung"/>
<display:column property="comp_id.acquirerId" width="10%" title="Acq." />
<display:column property="comp_id.cardId" width="10%" title="Karte" />
<display:column property="trxCount" width="10%" title="Anzahl" />
<display:column property="answerCode" width="10%" title="KV" />
<display:column property="eventCode" width="10%" title="ZT" />
<display:column property="trxType" width="10%" title="Typ" />
<display:column property="comp_id.cardId" width="10%" title="Fehlerbeschreibung" />
<c:set var="currentRow" value="${currentRow+1}" />
</display:table>
Ouput in HTML:
<td class="normalRow">
10
selectedRow
selectedRow
</td>
<td width="10%" class="normalRow">23.12.2003</td>
<td width="20%">0087175</td>
<td width="10%">0087175_desc</td>
Don't know why but "<%=(pageContext.getAttribute("rowClass")).toString()%>" is not
computed each time (blue and red parts). You can change
"<%=(pageContext.getAttribute("rowClass")).toString()%>" to
"<%=(pageContext.getAttribute("currentRow")).toString()%>" it will always give "0"
back.
Now the questions:
1) How can i make that "class" interprets the property each time?
2)Is there a solution to make this (select a row) with a decorator/table decorator ?
Thanks in advance
N¬HYÞéX¬²'²Þu¼ÂâìSºÚ+©lç(æ§{^®Ø,T^ãºËl
ªéz|¨º»$YlJ('ºèL°ZÞx¸§»îâj[yªçz÷«ÊØbë¢kay¶¬È^[h³+vh§
Xz0ÛiÿöÊ&ý§bw]»ñ©e¡Èß~õ¢%ÉÊek+Zë®f¢)à+-v+)¬j¬z¹b²Û,¢êÜyú+éÞm¦Ïÿ+-²Ê.Ç¢¸ë+-³ùb²Ø~ÝÊek+Zë