You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Matt Raible (JIRA)" <ta...@jakarta.apache.org> on 2006/12/29 03:08:21 UTC

[jira] Commented: (TAPESTRY-234) contrib:Table can't render column blocks when column name has period in it

    [ http://issues.apache.org/jira/browse/TAPESTRY-234?page=comments#action_12461295 ] 
            
Matt Raible commented on TAPESTRY-234:
--------------------------------------

After upgrading from 4.0.2 to 4.1.1, this doesn't seem to work again. The first part of the patch (contribTable.patch) seems to be there (for SimpleTableColumn.java), but not the 2nd part (for AbstractTableColumn.java).

Index: src/java/org/apache/tapestry/contrib/table/model/common/AbstractTableColumn.java
===================================================================
--- src/java/org/apache/tapestry/contrib/table/model/common/AbstractTableColumn.java	(revision 389802)
+++ src/java/org/apache/tapestry/contrib/table/model/common/AbstractTableColumn.java	(working copy)
@@ -222,13 +222,16 @@
      */
     public void loadSettings(IComponent objSettingsContainer)
     {
-        IComponent objColumnRendererSource = (IComponent) objSettingsContainer.getComponents().get(getColumnName() + COLUMN_RENDERER_BLOCK_SUFFIX);
+        // Replace any periods in the column name with underscores so columns can be referenced in a @Block
+        String columnName = getColumnName().replace('.', '_');
+
+        IComponent objColumnRendererSource = (IComponent) objSettingsContainer.getComponents().get(columnName + COLUMN_RENDERER_BLOCK_SUFFIX);
         if (objColumnRendererSource == null) 
         	objColumnRendererSource = (IComponent) objSettingsContainer.getComponents().get(COLUMN_RENDERER_BLOCK_SUFFIX);
         if (objColumnRendererSource != null && objColumnRendererSource instanceof Block)
     		setColumnRendererSource(new BlockTableRendererSource((Block) objColumnRendererSource));
 
-        IComponent objValueRendererSource = (IComponent) objSettingsContainer.getComponents().get(getColumnName() + VALUE_RENDERER_BLOCK_SUFFIX);
+        IComponent objValueRendererSource = (IComponent) objSettingsContainer.getComponents().get(columnName + VALUE_RENDERER_BLOCK_SUFFIX);
         if (objValueRendererSource == null)
         	objValueRendererSource = (IComponent) objSettingsContainer.getComponents().get(VALUE_RENDERER_BLOCK_SUFFIX);
         if (objValueRendererSource != null && objValueRendererSource instanceof Block)

> contrib:Table can't render column blocks when column name has period in it
> --------------------------------------------------------------------------
>
>                 Key: TAPESTRY-234
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-234
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Contrib
>    Affects Versions: 4.0.1
>            Reporter: Matt Raible
>         Assigned To: Jesse Kuhnert
>             Fix For: 4.0.1
>
>         Attachments: AbstractTableColumn.patch, contribTable.patch, SimpleTableColumn.patch
>
>
> I'm using the following column attribute in my contrib:Table:
> columns="user.username:username, user.firstName:firstName, user.lastName:lastName, user.email:email"
> If I try to override one of the column with an @Block, an error gets thrown.  It'd be nice if periods were allowed, possibly converted to underscores or something for the @Block element.  I'll attach a patch to SimpleTableColumn that makes this work.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org