click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadr...@apache.org
Subject svn commit: r1538300 - in /click/branches/click-3.0.0/click/framework: src/org/apache/click/control/Radio.java test/org/apache/click/control/FieldTest.java test/org/apache/click/control/RadioTest.java
Date Sat, 02 Nov 2013 23:34:34 GMT
Author: aadrian
Date: Sat Nov  2 23:34:34 2013
New Revision: 1538300

URL: http://svn.apache.org/r1538300
Log:
Radio control renders the Help text too now: issue #CLK-394

Modified:
    click/branches/click-3.0.0/click/framework/src/org/apache/click/control/Radio.java
    click/branches/click-3.0.0/click/framework/test/org/apache/click/control/FieldTest.java
    click/branches/click-3.0.0/click/framework/test/org/apache/click/control/RadioTest.java

Modified: click/branches/click-3.0.0/click/framework/src/org/apache/click/control/Radio.java
URL: http://svn.apache.org/viewvc/click/branches/click-3.0.0/click/framework/src/org/apache/click/control/Radio.java?rev=1538300&r1=1538299&r2=1538300&view=diff
==============================================================================
--- click/branches/click-3.0.0/click/framework/src/org/apache/click/control/Radio.java (original)
+++ click/branches/click-3.0.0/click/framework/src/org/apache/click/control/Radio.java Sat
Nov  2 23:34:34 2013
@@ -400,5 +400,10 @@ public class Radio extends Field {
             buffer.appendAttributeEscaped("value", getValue());
             buffer.elementEnd();
         }
+
+        // render the help hint if available
+        if (getHelp() != null) {
+            buffer.append(getHelp());
+        }
     }
 }

Modified: click/branches/click-3.0.0/click/framework/test/org/apache/click/control/FieldTest.java
URL: http://svn.apache.org/viewvc/click/branches/click-3.0.0/click/framework/test/org/apache/click/control/FieldTest.java?rev=1538300&r1=1538299&r2=1538300&view=diff
==============================================================================
--- click/branches/click-3.0.0/click/framework/test/org/apache/click/control/FieldTest.java
(original)
+++ click/branches/click-3.0.0/click/framework/test/org/apache/click/control/FieldTest.java
Sat Nov  2 23:34:34 2013
@@ -80,4 +80,13 @@ public class FieldTest extends TestCase 
         assertEquals(expectedValue, field.getValue());
         assertTrue(field.isValid());
     }
+
+    public void testHelp() {
+        MockContext context = MockContext.initContext();
+        Field field = new TextField("text");
+        // the help property can contain HTML too.
+        field.setHelp("<span class=\"help\">my help</span>");
+        assertTrue(field.toString().contains("my help"));
+        System.out.println("field.toString() = " + field.toString());
+    }
 }

Modified: click/branches/click-3.0.0/click/framework/test/org/apache/click/control/RadioTest.java
URL: http://svn.apache.org/viewvc/click/branches/click-3.0.0/click/framework/test/org/apache/click/control/RadioTest.java?rev=1538300&r1=1538299&r2=1538300&view=diff
==============================================================================
--- click/branches/click-3.0.0/click/framework/test/org/apache/click/control/RadioTest.java
(original)
+++ click/branches/click-3.0.0/click/framework/test/org/apache/click/control/RadioTest.java
Sat Nov  2 23:34:34 2013
@@ -184,6 +184,7 @@ public class RadioTest extends TestCase 
 
     /**
      * Coverage test of help property.
+     *
      */
     public void testHelp() {
         MockContext.initContext();
@@ -191,8 +192,9 @@ public class RadioTest extends TestCase 
         Radio field = new Radio("value");
         field.setHelp("help");
 
-        // Note that help is currently not rendered.
-        assertFalse(field.toString().contains("help"));
+        // Note that help is now rendered.
+        assertTrue(field.toString().contains("help"));
+        System.out.println("field.toString() = " + field.toString());
     }
 
     /**



Mime
View raw message