Author: tawus
Date: Sat Nov 12 03:48:14 2011
New Revision: 1201179
URL: http://svn.apache.org/viewvc?rev=1201179&view=rev
Log:
TAP5-1748: Added support for informal parameters in Alerts
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Alerts.java
tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/AlertsDemo.tml
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Alerts.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Alerts.java?rev=1201179&r1=1201178&r2=1201179&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Alerts.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Alerts.java
Sat Nov 12 03:48:14 2011
@@ -23,6 +23,7 @@ import org.apache.tapestry5.annotations.
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.RequestParameter;
import org.apache.tapestry5.annotations.SessionState;
+import org.apache.tapestry5.annotations.SupportsInformalParameters;
import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.json.JSONObject;
@@ -37,6 +38,7 @@ import org.apache.tapestry5.services.jav
* @tapestrydoc
* @since 5.3
*/
+@SupportsInformalParameters
public class Alerts implements ClientElement
{
@@ -64,6 +66,7 @@ public class Alerts implements ClientEle
clientId = javaScriptSupport.allocateClientId(resources);
writer.element("div", "id", clientId);
+ resources.renderInformalParameters(writer);
writer.end();
JSONObject spec = new JSONObject("id", clientId,
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy?rev=1201179&r1=1201178&r2=1201179&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy
Sat Nov 12 03:48:14 2011
@@ -109,4 +109,11 @@ class AlertsTests extends SeleniumTestCa
assertTrue isElementPresent("link=Zenbu Kesu")
}
+ @Test
+ void check_informal_parameters()
+ {
+ openLinks "Alerts Demo"
+ assertTrue isElementPresent("//div[@class='alert-class']")
+ }
+
}
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/AlertsDemo.tml
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/AlertsDemo.tml?rev=1201179&r1=1201178&r2=1201179&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/AlertsDemo.tml
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/AlertsDemo.tml
Sat Nov 12 03:48:14 2011
@@ -26,5 +26,5 @@
]
</p>
-<t:alerts dismissText="Zenbu Kesu"/>
+<t:alerts class='alert-class' dismissText="Zenbu Kesu"/>
</html>