Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=4095436
By: sunny17jain
Yea.. I have done this.. Actually.. it wld be better if u override addRowId
method of display tag,Performce wise it wld b better than javascript.I am giving
both the examples u can use any1 of ur choice..
Override addRowID()
<%request.setAttribute("dyndecorator", new
org.displaytag.decorator.TableDecorator()
{
public String addRowId()
{
return "" +
evaluate("rowId");
}
});
%>
Here they have use concept of inner class rowID is any property u want to keep
as id which wld b unique.. if not then set a bean property as a counter..just
mention display:table decorator ="dyndecorator"
Using jaavscript
Thsi is however simple to understand bt u can check the perforemace.Basically
this function wld go in onload f the page.
where detailRow is the id of the display table id attribute
var tab=document.getElementById('detailRow');
if(tab!=null){
var tbody = tab.getElementsByTagName("tbody")[0];
var tabRows=tbody.getElementsByTagName("tr");
for(var i=0;i<tabRows.length;i++){
var row=tabRows.item(i);
var check=row.getElementsByTagName("input")[0];
var rowId=check.value;
row.setAttribute("id",rowId);
}
}
______________________________________________________________________
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