The library offers another mechanism called Decorator. This makes class inheriting from the class TableDecorator.
In these classes define methods that will be called when generating tables. A mapping is automatically made between the attributes of property tags and column methods. You can easily change the look of the display of a column. For example, if you want to display currency or dates or if you want to dynamically generate html links. In your java you will create the code below:
Code:
Public class Designing extends TableDecorator
{
Public String getMyLink ()
{
User use = (User) getCurrentRowObject ();
int lid = use.getId ();
return "<a href = \" details.jsp? useid = " + Lid + "\"> Edit </ a> ";
}
}
And your jsp page must contains the below code:
Code:
<display: table name ="mylist" decorator ="Designing" />
<display: column property ="id" title ="No." />
<display: column property ="name" title ="Name" />
<display: column property ="firstname" title ="Name" />
<display: column property ="email" title ="Email" />
<display: column property ="myLinks" title ="" />
</ display: table>
Bookmarks