Message: A new issue has been created in JIRA.
--------------------------------------------------------------------- View the issue: http://jira.codehaus.org/browse/DISPL-173 Here is an overview of the issue: --------------------------------------------------------------------- Key: DISPL-173 Summary: Dynamic column configuration using template columns Type: New Feature Status: Unassigned Priority: Major Original Estimate: 2 weeks Time Spent: Unknown Remaining: 2 weeks Project: DisplayTag Components: Tag Library Assignee: Reporter: Paul K McCulloch Created: Wed, 12 Jan 2005 7:45 AM Updated: Wed, 12 Jan 2005 7:45 AM Description: Allow the definition of the columns to be displayed to be defined outside the JSP. This will allow fetures such as column builders to be implemented. It should be possible to use JSP defined columns as templates for columns defined externally. I've already started work on this as outlined below, but I'd appreciate feedback on my proposed implementation. Proposal ======== Column tags are extended to give them a name attribute. The table tag is enhanced to accept a new attribute - configBeanName. This specifies a scoped attribute containing a configuration bean. This configuration bean is an ordered list of columns to display. Each entry can be either a named column, or a property/name pair. Columns are rendered in the order listed in the configuration bean. Columns listed by name only are rendered as-is. Columns listed as a propery/name pair are rendered using the named column as a template, with the bean specified property used in preference to any property defined in the JSP. Columns not listed in the bean, but defined in the JSP are not rendered. In addition the column tag is extended to expose, to it's body, an attribute containing the current cell's property. Here's an example: <% //Create a config bean TableConfig conf = new TableConfig(); conf.setDisplayColumns(new ColumnConfig[]{ new ColumnConfig("reference"), //display the reference column new ColumnConfig("startDate", "dateTemplate"), //then a column for the property startDate using the 'dateTemplate' column as a template new ColumnConfig("endDate", "dateTemplate"), //then a column for the property endDate using the 'dateTemplate' column as a template new ColumnConfig("startRemarks", "remarks"), //then a column for the property startRemarks using the 'remarks' column as a template new ColumnConfig("id") //then the id column }); request.getSession().setAttribute("myConfigBean", conf); %> <display:table name="TheList" configBeanName="sessionScope.myConfigBean" id="currentrow"> <display:column name="remarks" maxLength="100" /> <display:column name="dateTemplate" var="cellvalue"> <fmt:formatDate value="${cellvalue}" type="date" dateStyle="SHORT" timeStyle="SHORT"/> </display:column> <display:column name="reference"> Ref: <c:out value="currentrow.reference"/> </display:column> <display:column name="id" property="id"> </display:table> --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ displaytag-devel mailing list displaytag-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/displaytag-devel