Re: How to use property attributes on column tags for DisplayTag tables in Freemarker templates?

"Newman, John W" <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <D688C4D318A63D4290AA94A33E06F7D20207DEDC86@msxmbxnsprd14.acct.upmchs.net>
           [@display.column property="scheme" title="Scheme" ]

Should work correctly... I have used that many times with the same stack you are using without any issues.  Are you using BeansWrapper?  If not that may be why, give it a shot.

The 1st, 3rd, and 4th versions are incorrect, but it looks like you are missing a jar file somewhere.


From: Geoff Shuetrim [mailto:[email protected]]
Sent: Tuesday, August 11, 2009 10:04 PM
To: Freemarker users mailing list
Subject: [FreeMarker-user] How to use property attributes on column tags for DisplayTag tables in Freemarker templates?

I am using the following setup and having some trouble in getting the table rendering to work
with the DisplayTag library.

Tomcat 6.0.20
Freemarker 2.3.25
Stripes 1.5.1
DisplayTag 1.2

Specifically, I am setting up a list of java.net.URI objects in the data model (accessible as
actionBean.uris from within Freemarker templates).  I am then attempting to render information
about these URIs using the Displaytag table and column tags.

[@display.table name=actionBean.uris id="table" pagesize=10
requestURI="/browser/search/OtherPage.action"]
           [@display.column title="Scheme" ]
               ${table.scheme}
           [/@]
           [@display.column title="Host" ]
               ${table.host}
           [/@]
           [@display.column title="Path" ]
               ${table.path}
           [/@]
[/@]

When I browse the relevant web page, generated by the Freemarker template,
I get a table showing that there are 40 URIs in the list (as expected) and I get
the data for all three columns.

Next I try to use the property attribute of the column tag and I run into trouble.
I have tested the following alternatives for the scheme column but no luck.

           [@display.column property=scheme title="Scheme" ]
           [@display.column property="scheme" title="Scheme" ]

These two result in nothing being shown in the first column but everything
else rendering fine.

           [@display.column property=table.scheme title="Scheme" ]
           [@display.column property="table.scheme" title="Scheme" ]

These two result in the following stack trace:

java.lang.NoClassDefFoundError: org/apache/commons/beanutils/NestedNullException

        org.displaytag.model.Column.getValue(Column.java:124)

        org.displaytag.model.Column.createChoppedAndLinkedValue(Column.java:201)





        org.displaytag.model.Column.initialize(Column.java:178)

        org.displaytag.render.TableWriterTemplate.writeTableBody(TableWriterTemplate.java:313)

        org.displaytag.render.TableWriterTemplate.writeTable(TableWriterTemplate.java:138)





        org.displaytag.render.HtmlTableWriter.writeTable(HtmlTableWriter.java:734)

        org.displaytag.tags.TableTag.writeHTMLData(TableTag.java:1647)

        org.displaytag.tags.TableTag.doEndTag(TableTag.java:1300)

        freemarker.ext.jsp.TagTransformModel$TagWriter.endEvaluation(TagTransformModel.java:431)





        freemarker.ext.jsp.TagTransformModel$TagWriter.afterBody(TagTransformModel.java:407)

There seem to be a number of similar questions raised on this mailing list, but
none have suggested a syntax that works.

Thanks in advance for your assistance,

Geoff Shuetrim

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.