Since I got lots of replies asking for the code, I'll just post it to the list to make 
things easier. FYI: I tested the code, works for me... no guarantees that this code is 
100% correct. Enjoy:

Add the following to the ColumnTag class

    /* begin: added by vic - 8/14/03 */
    public void doInitBody() throws javax.servlet.jsp.JspException{}
    
    public int doAfterBody() throws javax.servlet.jsp.JspException {  
        BodyContent bc = super.getBodyContent();

        try {
            this.setBodyStuff(this.getBodyContent().getString());
            bc.clear();
        } catch (NullPointerException e) {
            //just make bodyStuff an empty string
            this.setBodyStuff("");
        } catch (IOException ie) {
            //do nothing
        }
        return SKIP_BODY;
    }
    
    private String bodyStuff;
    
    public void setBodyStuff(String v) {
        this.bodyStuff = v;
    }
    
    public String getBodyStuff() {
        return this.bodyStuff;
    }
    /* end added by vic - 8/14/03  */



In the TableTag class, in the getHTMLData method, after the comment that says:
"// Get the value to be displayed for the column"

modify to look like the following:

            .
            .
            .
            Object value = null;
            if( tag.getValue() != null ) {
                /* begin: modified by vic - 8/14/03 */
                String theBody = tag.getBodyStuff();
                if (theBody != null) {
                    value = theBody;
                }
               //keep the value from the value attribute in case you want it
               value = value + tag.getValue();
               /* end: modified by vic - 8/14/03 */
            } else {
            .
            .
            .


―---------------------------------------------
-----Original Message-----
From: Victor Soares [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 14, 2003 6:31 PM
To: [EMAIL PROTECTED] 
Subject: [displaytag-user] Modified column tag to evaluate body


Hello,
I don't know if anybody else is interested in this, but I modified the
source code for my application so that the column tag evaluates the body.
This makes it really easy to throw in an additional column that is unrelated
to the collection being displayed without using the decorator.

If anybody is interested in what needs to be added/modified in the source,
shoot me an email.

Later,
- Vic



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data
Reports, E-commerce, Portals, and Forums are available now. Download today
and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 
_______________________________________________
displaytag-user mailing list [EMAIL PROTECTED] 
https://lists.sourceforge.net/lists/listinfo/displaytag-user



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
displaytag-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to