Read and respond to this message at: 
https://sourceforge.net/forum/message.php?msg_id=5674529
By: ed_j_webb

You can achieve this by using a Decorator.

Your jsp:

<display:table id="myTable" decorator="my.decorator.MyDecorator">
    <display:column property="date" titleKey="header.date"/>
    <display:column property="id" titleKey="header.id"/>
    <display:column property="name" titleKey="header.name"/>
    <display:column property="adjust" titleKey="header.adjust"/>
    <%-- notice no mention of the comment column --%>
</display:table>

and implement the TableDecorator class:

package my.decorator;

import org.displaytag.decorator.TableDecorator;

public class MyDecorator extends TableDecorator {
    
    /**
     * Adds a comment row to the table.
     */
    public String finishRow() {
        StringBuffer footer = new StringBuffer();
        MyObject curr = (MyObject)this.getCurrentRowObject();
        footer.append("<tr><td>&nbsp;</td><td colspan\"3\">");
        footer.append(myObject.getComment());
        footer.append("</td></tr>");
        return footer.toString();
    }
}

Ed!


______________________________________________________________________
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

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to