Hi
I am try to get my table td id 0r name and then used it into my behavior.
But for some reason it doesn't seem to be working.
Please could some see my code, why it is not picking my table td id.
many thank
<?xml version="1.0" encoding="UTF-8"?>
<div xmlns:s="http://www.backbase.com/s/"
xmlns:b="http://www.backbase.com/b/"
xmlns="http://www.w3.org/1999/xhtml">
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="spring" uri="/" %>
<%@ include file="/WEB-INF/jsp/includes/include.jsp" %>
<meta http-equiv="expires" content="Mon, 06 Jan 1990 00:00:01 GMT"/>
<style type="text/css">
.odd1 { background-color: #ffcc11; }
.even1 { background-color: #ffffcc; }
</style>
Here goes overview data ...........
<div id="pkgPkgListA">
<s:behavior b:name="setstyle-example">
<s:event b:on="select">
<s:with b:target="../..">
<s:setstyle b:background-color="#7C90CD" />
</s:with>
<s:with b:target="../../td">
<s:setstyle b:color="#FFFFFF" />
</s:with>
</s:event>
<s:event b:on="deselect">
<s:with b:target="../..">
<s:setstyle b:background-color="#FFFFFF" />
</s:with>
<s:with b:target="../../td">
<s:setstyle b:color="#000000" />
<s:variable b:name="rowClass" b:scope="local" b:select="./@b:name" /> <== Not picking variable here
<s:task b:action="alert" b:value="{$rowClass}" />
<s:choose>
<s:when b:test="@b:name = 'odd1'"> <== Not looping through
<s:task b:action="alert" b:value="Loop 1" />
<s:setstyle b:background-color="#ffcc11" />
</s:when>
<s:otherwise>
<s:task b:action="alert" b:value="Loop 2" />
<s:setstyle b:background-color="#ffffcc" />
</s:otherwise>
</s:choose>
</s:with>
</s:event>
</s:behavior>
<b:spacer b:width="0px" b:height="5px" />
<table>
<thead>
<tr>
<th></th>
<th style="width: 100px, background-color:FFccFc;">Col A</th>
<th style="width: 160px;">Col B</th>
</tr>
</thead>
<c:forEach var="pkgPkgListA" items="${pkgPkgListA}" varStatus="rowCounter">
<c:choose>
<c:when test="${rowCounter.count % 2 == 0}">
<c:set var="rowStyle" scope="page" value="odd1"/>
</c:when>
<c:otherwise>
<c:set var="rowStyle" scope="page" value="even1"/>
</c:otherwise>
</c:choose>
<tbody>
<tr class="${rowStyle}">
<td><input b:behavior="setstyle-example" b:name="${rowStyle}" id="${rowStyle}" type="checkbox" /></td> <== Need to get this id
<td><c:out value="${pkgPkgListA.attribute1}"/></td>
<td><c:out value="${pkgPkgListA.attribute2}"/></td>
</tr>
</tbody>
</c:forEach>
</table>
</div>
</div>
<div xmlns:s="http://www.backbase.com/s/"
xmlns:b="http://www.backbase.com/b/"
xmlns="http://www.w3.org/1999/xhtml">
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="spring" uri="/" %>
<%@ include file="/WEB-INF/jsp/includes/include.jsp" %>
<meta http-equiv="expires" content="Mon, 06 Jan 1990 00:00:01 GMT"/>
<style type="text/css">
.odd1 { background-color: #ffcc11; }
.even1 { background-color: #ffffcc; }
</style>
Here goes overview data ...........
<div id="pkgPkgListA">
<s:behavior b:name="setstyle-example">
<s:event b:on="select">
<s:with b:target="../..">
<s:setstyle b:background-color="#7C90CD" />
</s:with>
<s:with b:target="../../td">
<s:setstyle b:color="#FFFFFF" />
</s:with>
</s:event>
<s:event b:on="deselect">
<s:with b:target="../..">
<s:setstyle b:background-color="#FFFFFF" />
</s:with>
<s:with b:target="../../td">
<s:setstyle b:color="#000000" />
<s:variable b:name="rowClass" b:scope="local" b:select="./@b:name" /> <== Not picking variable here
<s:task b:action="alert" b:value="{$rowClass}" />
<s:choose>
<s:when b:test="@b:name = 'odd1'"> <== Not looping through
<s:task b:action="alert" b:value="Loop 1" />
<s:setstyle b:background-color="#ffcc11" />
</s:when>
<s:otherwise>
<s:task b:action="alert" b:value="Loop 2" />
<s:setstyle b:background-color="#ffffcc" />
</s:otherwise>
</s:choose>
</s:with>
</s:event>
</s:behavior>
<b:spacer b:width="0px" b:height="5px" />
<table>
<thead>
<tr>
<th></th>
<th style="width: 100px, background-color:FFccFc;">Col A</th>
<th style="width: 160px;">Col B</th>
</tr>
</thead>
<c:forEach var="pkgPkgListA" items="${pkgPkgListA}" varStatus="rowCounter">
<c:choose>
<c:when test="${rowCounter.count % 2 == 0}">
<c:set var="rowStyle" scope="page" value="odd1"/>
</c:when>
<c:otherwise>
<c:set var="rowStyle" scope="page" value="even1"/>
</c:otherwise>
</c:choose>
<tbody>
<tr class="${rowStyle}">
<td><input b:behavior="setstyle-example" b:name="${rowStyle}" id="${rowStyle}" type="checkbox" /></td> <== Need to get this id
<td><c:out value="${pkgPkgListA.attribute1}"/></td>
<td><c:out value="${pkgPkgListA.attribute2}"/></td>
</tr>
</tbody>
</c:forEach>
</table>
</div>
</div>
