Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4071736 By: metafeather
Trawling through the lists shows that this question has been raised a number of times and not satifactorily answered from a web design point of view: e.g. in 2004: http://sourceforge.net/mailarchive/message.php?msg_id=9660486 This approach mentioned before may appear to result in the same visual display, but it is not the same thing as actually setting the class on the 'td' tag itself, and is restrictive to the adoption of display:tag on existing pages/tables as it requires any exisiting CSS to be changed. Additionally putting HTML code in the decorator's Java class pretty much breaks is benefits as a decorator. One option is to use JSTL to evaluate the desired logic to create a local var and output this, even if its an empty string e.g.: <c:choose> <c:when test="${co.activeElement}"> <c:set var="coStyle" value="active"/> </c:when> <c:otherwise> <c:set var="coStyle" value="inactive"/> </c:otherwise> </c:choose> <display:column class="${coStyle}"> As the class attribute is a passthrough, this will work for most usecases but is putting logic that belongs in the decorator in the page and so subject to implementation errors. Since there are 'addRowClass' and 'addRowId' methods for TableDecorator (the javadocs on this site appear out of date), and that you can assign decorators to columns it would seem reasonable to expect there to be 'addCellClass' and 'addCellId' methods available to be used. Here is a real world example as to why this is neccessary (apart from not neccessarily being able to change the CSS): #coList td.defaultCo { background-image:url(/web/ui-html/images/icon-confirm-small.png); background-position:center; background-repeat:no-repeat; min-height:20px; min-width:24px; } #coList td.defaultCo span display:none; } <td class="defaultCo"> <span>This is the default</span> </td> This shows a nice icon for most users, which is reliably centered in the cell no matter what the size/shape of the table. The text within is hidden for most users unless they are using an assistive or mobile browserin which case they hear/see the text. This also has benefits for automated application testing. Hope this helps. regards Liam Clancy (metafeather) ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=249317 ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ displaytag-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/displaytag-user

