You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2008/03/09 03:50:51 UTC

svn commit: r635145 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry/corelib/components/ main/resources/org/apache/tapestry/corelib/components/ test/app1/ test/java/org/apache/tapestry/integration/ test/java/org/apache/ta...

Author: hlship
Date: Sat Mar  8 18:50:49 2008
New Revision: 635145

URL: http://svn.apache.org/viewvc?rev=635145&view=rev
Log:
TAPESTRY-2218: Grid component should render informal parameters

Added:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Any.java
      - copied, changed from r635006, tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/components/Any.java
Removed:
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/components/Any.java
Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Grid.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Grid.tml
    tapestry/tapestry5/trunk/tapestry-core/src/test/app1/GridSetDemo.tml
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/components/OuterAny.java

Copied: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Any.java (from r635006, tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/components/Any.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Any.java?p2=tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Any.java&p1=tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/components/Any.java&r1=635006&r2=635145&rev=635145&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/components/Any.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Any.java Sat Mar  8 18:50:49 2008
@@ -12,13 +12,16 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.integration.app1.components;
+package org.apache.tapestry.corelib.components;
 
 import org.apache.tapestry.ComponentResources;
 import org.apache.tapestry.MarkupWriter;
 import org.apache.tapestry.annotations.SupportsInformalParameters;
 import org.apache.tapestry.ioc.annotations.Inject;
 
+/**
+ * Renders an arbitrary element including informal parameters.
+ */
 @SupportsInformalParameters
 public class Any
 {

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Grid.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Grid.java?rev=635145&r1=635144&r2=635145&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Grid.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Grid.java Sat Mar  8 18:50:49 2008
@@ -154,6 +154,14 @@
     @Property(write = false)
     private String _rowClass;
 
+    /**
+     * CSS class for the <table> element.  In addition, informal parameters to the Grid are rendered in the table
+     * element.
+     */
+    @Parameter(name = "class", defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX, value = "t-data-grid")
+    @Property(write = false)
+    private String _tableClass;
+
     @Persist
     private int _currentPage = 1;
 
@@ -191,6 +199,9 @@
     @Component(parameters = "to=pagerBottom")
     private Delegate _pagerBottom;
 
+    @SuppressWarnings("unused")
+    @Component(parameters = "class=tableClass", inheritInformalParameters = true)
+    private Any _table;
 
     @Environmental(false)
     private FormSupport _formSupport;

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Grid.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Grid.tml?rev=635145&r1=635144&r2=635145&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Grid.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Grid.tml Sat Mar  8 18:50:49 2008
@@ -2,7 +2,7 @@
 
     <div t:id="pagerTop"/>
 
-    <table class="t-data-grid">
+    <table t:id="table">
         <thead t:id="columns"/>
         <tbody>
             <tr t:id="rows"/>

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/GridSetDemo.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/GridSetDemo.tml?rev=635145&r1=635144&r2=635145&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/GridSetDemo.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/GridSetDemo.tml Sat Mar  8 18:50:49 2008
@@ -2,7 +2,7 @@
 
     <h1>Grid Set Demo</h1>
 
-    <table t:type="Grid" source="tracks" row="track">
+    <table t:type="Grid" source="tracks" row="track" informal="supported">
         <t:parameter name="ratingcell">
             <t:outputRating rating="track.rating"/>
         </t:parameter>

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java?rev=635145&r1=635144&r2=635145&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java Sat Mar  8 18:50:49 2008
@@ -702,6 +702,10 @@
         start("Grid Set Demo");
 
         assertFalse(isTextPresent("Exception"));
+
+        // Also check for TAPESTRY-2228
+
+        assertAttribute("//table/@informal", "supported");
     }
 
     @Test

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/components/OuterAny.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/components/OuterAny.java?rev=635145&r1=635144&r2=635145&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/components/OuterAny.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/components/OuterAny.java Sat Mar  8 18:50:49 2008
@@ -16,6 +16,7 @@
 
 import org.apache.tapestry.annotations.Component;
 import org.apache.tapestry.annotations.SupportsInformalParameters;
+import org.apache.tapestry.corelib.components.Any;
 
 @SupportsInformalParameters
 public class OuterAny