On the subject of 'dynamic'-ness for displaytag, I would like to provide
some feedback.
I would like to see a way to define a table in a java class, not in the
JSP using it. In other words, I'd like to see a 'table definition'
class that gets provided as an attribute to the <displaytag:table>
element. The 'table definition' would contain information on the number
of columns, the properties of each column, and how to display the
content of each cell in that column.
'But the TableDecorator class already does that', you say. Well, not
really. Basically, a TableDecorator is a collection of
ColumnDecorators, where both are soley focused on how the contents of a
cell are displayed. This is different from a 'table definition' in that
a definition contains the number of columns, the titles of the columns,
whether or not a column is sortable, etc, etc, etc.
Why do I think this is needed? Let me give you an example. I have a
two-part page, the top part is a search input area, where users enter
information that they want to find. The bottom part is a table
containing the search results. Depending on where they want to search,
the resulting table will have different columns. If they are searching
in domain X, the resulting table will have 3 columns (name, address,
phone), if they are searching in domain Y, the table will have 4 columns
(ip, os, active, desc).
I'm actually doing something like this right now. I have had to create
a TableDefinition class, that my search page uses. It iterates over the
column definitions using an iterate tag (either from JSTL or Struts)
creating the table. Here's a snippet of how it's used:
<display:table
class="generic_table"
decorator="${SearchFormBean.tableDesc.tableDecoratorClassname}"
list="${SearchFormBean.searchResults}"
pagesize="${loggeduser.itemsPerPage}"
requestURI="Search.do"
sort="list"
>
<logic:iterate
id="currentCol"
name="SearchFormBean"
property="tableDesc.columnDescriptions">
<display:column
property="${currentCol.property}"
sortable="${currentCol.sortable}" />
</logic:iterate>
</display:table>
Now, if the <displaytag> supported a 'tableDefinition' attribute, where
it went off and retrieved the information, that would make things easier
for me.
There are additional advantages to the concept of defining the table
outside of the JSP: the primary one being that if I have two or three
JSPs using the same tables, then I can define the table once, in the
table definition. Alterations to that definition are automatically
reflected in all JSPs that use this definition.
So, to summarize, the advantages of adding the concept of a 'table
definition' class include having a single <displaytag> instance showing
multiple table types, and having a single point of table definition
where that table is being used in multiple areas.
I hope you find this feedback useful. I am hoping to be able to
participate in this project as a developer, but I'm already spreading
myself too thin.
JDG
--
Jay Glanville
-----Original Message-----
From: Fabrizio Giustina
[mailto:[EMAIL PROTECTED] On Behalf Of
Fabrizio Giustina
Sent: Friday, March 19, 2004 3:30 AM
To: [EMAIL PROTECTED]
Subject: RE: [displaytag-user] dynamic columns support
What do you mean with "dinamic columns"?
Starting from b2 you can create a table without adding any column and
displaytag will add one for any property in the underlying object. Is
this what you are looking for?
fabrizio
From: [EMAIL PROTECTED] on behalf of Harod
Ruthgar
Sent: Fri 19/03/2004 8.43
To: [EMAIL PROTECTED]
Subject: [displaytag-user] dynamic columns support
Is there any plan in displaytag roadmap to support
dynamic columns in the future?
Is there anyone starting the work in that area?
Could the development team please respond to this
issue? I read trough the mailing list and someone
already ask about dynamic column last year, but no one responded.
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
displaytag-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-user