You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ri...@apache.org on 2005/08/15 23:43:54 UTC

svn commit: r232888 - in /beehive/trunk/netui: src/tags-html/org/apache/beehive/netui/tags/html/ test/webapps/drt/coreWeb/tags/attribute/ test/webapps/drt/testRecorder/tests/

Author: rich
Date: Mon Aug 15 14:43:35 2005
New Revision: 232888

URL: http://svn.apache.org/viewcvs?rev=232888&view=rev
Log:
This is a contribution from Carlin Rogers to address  http://issues.apache.org/jira/browse/BEEHIVE-842 : netui:attribute's on the checkBoxOption tag are not being set or overriden

tests: bvt in netui (WinXP)
BB: self (linux)


Modified:
    beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxOption.java
    beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RadioButtonOption.java
    beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/checkBoxOption.jsp
    beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/checkBoxOptionErrors.jsp
    beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/radioButtonOption.jsp
    beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/radioButtonOptionErrors.jsp
    beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AttributeTag.xml
    beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AttributeTagErrors.xml

Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxOption.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxOption.java?rev=232888&r1=232887&r2=232888&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxOption.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxOption.java Mon Aug 15 14:43:35 2005
@@ -98,6 +98,10 @@
                 }
             }
         }
+        if (facet != null && facet.equals("label")) {
+            setStateAttribute(name, value, _spanState);
+            return;
+        }
         super.setAttribute(name, value, facet);
     }
 

Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RadioButtonOption.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RadioButtonOption.java?rev=232888&r1=232887&r2=232888&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RadioButtonOption.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RadioButtonOption.java Mon Aug 15 14:43:35 2005
@@ -74,6 +74,8 @@
      * and <code>value</code> attribute.
      * @param name  The name of the attribute
      * @param value The value of the attribute
+     * @param facet The name of a facet to which the attribute will be applied.  This is optional.
+     * @throws JspException A JspException may be thrown if there is an error setting the attribute.
      */
     public void setAttribute(String name, String value, String facet)
             throws JspException
@@ -89,6 +91,10 @@
                     return;
                 }
             }
+        }
+        if (facet != null && facet.equals("label")) {
+            setStateAttribute(name, value, _spanState);
+            return;
         }
         super.setAttribute(name, value, facet);
     }

Modified: beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/checkBoxOption.jsp
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/checkBoxOption.jsp?rev=232888&r1=232887&r2=232888&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/checkBoxOption.jsp (original)
+++ beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/checkBoxOption.jsp Mon Aug 15 14:43:35 2005
@@ -38,7 +38,19 @@
                     <%-- Test a regular old attribute --%>
                     <netui:attribute name="anotherCustomAttr" value="anotherCustomValue"/>
                 </netui:checkBoxOption>
-                <netui:checkBoxOption value="${pageFlow.optionTwo}"></netui:checkBoxOption>
+                <netui:checkBoxOption value="${pageFlow.optionTwo}">
+                    <%-- Test override on inner span --%>
+                    <netui:attribute facet="label" name="class" value="aLabelStyleClass"/>
+                    <netui:attribute facet="label" name="style" value="aLabelStyle"/>
+                    
+                    <%-- Test netui expression on inner span --%>
+                    <%
+                        pageContext.setAttribute("color", new String("red"));
+                    %>
+                    <netui:attribute facet="label" name="customAttr" value="${pageScope.color}"/>
+                    <%-- Test a regular old attribute on inner span --%>
+                    <netui:attribute facet="label" name="anotherCustomAttr" value="anotherCustomValue"/>
+                </netui:checkBoxOption>
                 <netui:checkBoxOption value="${pageFlow.optionThree}"></netui:checkBoxOption>
             </netui:checkBoxGroup>
             <netui:button value="submitIt" type="submit"/>

Modified: beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/checkBoxOptionErrors.jsp
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/checkBoxOptionErrors.jsp?rev=232888&r1=232887&r2=232888&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/checkBoxOptionErrors.jsp (original)
+++ beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/checkBoxOptionErrors.jsp Mon Aug 15 14:43:35 2005
@@ -46,7 +46,24 @@
                     <netui:attribute name="value" value="whatever"/>
                     <netui:attribute name="checked" value="whatever"/>
                 </netui:checkBoxOption>
-                <netui:checkBoxOption value="${pageFlow.optionTwo}"></netui:checkBoxOption>
+                <netui:checkBoxOption value="${pageFlow.optionTwo}">
+                    <%-- Test override on inner span --%>
+                    <netui:attribute facet="label" name="class" value="aLabelStyleClass"/>
+                    <netui:attribute facet="label" name="style" value="aLabelStyle"/>
+                    
+                    <%-- Test netui expression on inner span --%>
+                    <%
+                        pageContext.setAttribute("color", new String("red"));
+                    %>
+                    <netui:attribute facet="label" name="customAttr" value="${pageScope.color}"/>
+                    <%-- Test a regular old attribute on inner span --%>
+                    <netui:attribute facet="label" name="anotherCustomAttr" value="anotherCustomValue"/>
+
+                    <%-- Test disallowed attributes on inner span --%>
+                    <%-- these cause errors --%>
+                    <netui:attribute facet="label" name="id" value="whatever"/>
+                    <netui:attribute facet="label" name="name" value="whatever"/>
+                </netui:checkBoxOption>
                 <netui:checkBoxOption value="${pageFlow.optionThree}"></netui:checkBoxOption>
             </netui:checkBoxGroup>
             <netui:button value="submitIt" type="submit"/>

Modified: beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/radioButtonOption.jsp
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/radioButtonOption.jsp?rev=232888&r1=232887&r2=232888&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/radioButtonOption.jsp (original)
+++ beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/radioButtonOption.jsp Mon Aug 15 14:43:35 2005
@@ -38,7 +38,19 @@
                     <%-- Test a regular old attribute --%>
                     <netui:attribute name="anotherCustomAttr" value="anotherCustomValue"/>
                 </netui:radioButtonOption>
-                <netui:radioButtonOption value="${pageFlow.optionTwo}"></netui:radioButtonOption>
+                <netui:radioButtonOption value="${pageFlow.optionTwo}">
+                    <%-- Test override on inner span --%>
+                    <netui:attribute facet="label" name="class" value="aLabelStyleClass"/>
+                    <netui:attribute facet="label" name="style" value="aLabelStyle"/>
+
+                    <%-- Test netui expression on inner span --%>
+                    <%
+                        pageContext.setAttribute("color", new String("red"));
+                    %>
+                    <netui:attribute facet="label" name="customAttr" value="${pageScope.color}"/>
+                    <%-- Test a regular old attribute on inner span --%>
+                    <netui:attribute facet="label" name="anotherCustomAttr" value="anotherCustomValue"/>
+                </netui:radioButtonOption>
                 <netui:radioButtonOption value="${pageFlow.optionThree}"></netui:radioButtonOption>
             </netui:radioButtonGroup>
             <netui:button value="submitIt" type="submit"/>

Modified: beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/radioButtonOptionErrors.jsp
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/radioButtonOptionErrors.jsp?rev=232888&r1=232887&r2=232888&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/radioButtonOptionErrors.jsp (original)
+++ beehive/trunk/netui/test/webapps/drt/coreWeb/tags/attribute/radioButtonOptionErrors.jsp Mon Aug 15 14:43:35 2005
@@ -46,7 +46,24 @@
                     <netui:attribute name="value" value="whatever"/>
                     <netui:attribute name="checked" value="whatever"/>
                 </netui:radioButtonOption>
-                <netui:radioButtonOption value="${pageFlow.optionTwo}"></netui:radioButtonOption>
+                <netui:radioButtonOption value="${pageFlow.optionTwo}">
+                    <%-- Test override on inner span --%>
+                    <netui:attribute facet="label" name="class" value="aLabelStyleClass"/>
+                    <netui:attribute facet="label" name="style" value="aLabelStyle"/>
+
+                    <%-- Test netui expression on inner span --%>
+                    <%
+                        pageContext.setAttribute("color", new String("red"));
+                    %>
+                    <netui:attribute facet="label" name="customAttr" value="${pageScope.color}"/>
+                    <%-- Test a regular old attribute on inner span --%>
+                    <netui:attribute facet="label" name="anotherCustomAttr" value="anotherCustomValue"/>
+
+                    <%-- Test disallowed attributes on inner span --%>
+                    <%-- these cause errors --%>     
+                    <netui:attribute name="id" value="whatever"/>
+                    <netui:attribute name="name" value="whatever"/>
+                </netui:radioButtonOption>
                 <netui:radioButtonOption value="${pageFlow.optionThree}"></netui:radioButtonOption>
             </netui:radioButtonGroup>
             <netui:button value="submitIt" type="submit"/>

Modified: beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AttributeTag.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AttributeTag.xml?rev=232888&r1=232887&r2=232888&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AttributeTag.xml (original)
+++ beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AttributeTag.xml Mon Aug 15 14:43:35 2005
@@ -365,7 +365,7 @@
         <form action="/coreWeb/tags/attribute/submitIt.do" method="post">
             <input type="hidden" name="wlw-checkbox_group_key:{actionForm.checkedBoxes}OldValue" value="true">
                 <input type="checkbox" name="wlw-checkbox_group_key:{actionForm.checkedBoxes}" class="MyAttributeClass" value="One" checked customAttr="red" anotherCustomAttr="anotherCustomValue" style="MyAttributeStyle"><span class="theLabelStyleClass" style="theLabelStyle">One</span>
-                <input type="checkbox" name="wlw-checkbox_group_key:{actionForm.checkedBoxes}" value="Two" checked><span>Two</span>
+                <input type="checkbox" name="wlw-checkbox_group_key:{actionForm.checkedBoxes}" value="Two" checked><span class="aLabelStyleClass" customAttr="red" anotherCustomAttr="anotherCustomValue" style="aLabelStyle">Two</span>
                 <input type="checkbox" name="wlw-checkbox_group_key:{actionForm.checkedBoxes}" value="Three" checked><span>Three</span>
             
             <input type="submit" value="submitIt">
@@ -981,7 +981,7 @@
         <form action="/coreWeb/tags/attribute/submitIt.do" method="post">
             
                 <input type="radio" name="wlw-radio_button_group_key:{actionForm.theProperty}" class="MyAttributeClass" value="One" customAttr="red" anotherCustomAttr="anotherCustomValue" style="MyAttributeStyle"><span class="theLabelStyleClass" style="theLabelStyle">One</span>
-                <input type="radio" name="wlw-radio_button_group_key:{actionForm.theProperty}" value="Two" checked><span>Two</span>
+                <input type="radio" name="wlw-radio_button_group_key:{actionForm.theProperty}" value="Two" checked><span class="aLabelStyleClass" customAttr="red" anotherCustomAttr="anotherCustomValue" style="aLabelStyle">Two</span>
                 <input type="radio" name="wlw-radio_button_group_key:{actionForm.theProperty}" value="Three"><span>Three</span>
             
             <input type="submit" value="submitIt">

Modified: beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AttributeTagErrors.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AttributeTagErrors.xml?rev=232888&r1=232887&r2=232888&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AttributeTagErrors.xml (original)
+++ beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AttributeTagErrors.xml Mon Aug 15 14:43:35 2005
@@ -399,7 +399,8 @@
             <input type="hidden" name="wlw-checkbox_group_key:{actionForm.checkedBoxes}OldValue" value="true">
                 <span style="color:red;background-color:white">
  [<b>Tag Error:1</b>, Found in tag <b>CheckBoxOption</b>]</span>
-                <input type="checkbox" name="wlw-checkbox_group_key:{actionForm.checkedBoxes}" value="Two" checked><span>Two</span>
+                <span style="color:red;background-color:white">
+ [<b>Tag Error:6</b>, Found in tag <b>CheckBoxOption</b>]</span>
                 <input type="checkbox" name="wlw-checkbox_group_key:{actionForm.checkedBoxes}" value="Three" checked><span>Three</span>
             
             <input type="submit" value="submitIt">
@@ -413,6 +414,8 @@
 <tr><th>3</th><th>CheckBoxOption</th><th>Message</th><td>The attribute "<b>type</b>" may not be set through the Attribute tag.</td></tr>
 <tr><th>4</th><th>CheckBoxOption</th><th>Message</th><td>The attribute "<b>value</b>" may not be set through the Attribute tag.</td></tr>
 <tr><th>5</th><th>CheckBoxOption</th><th>Message</th><td>The attribute "<b>checked</b>" may not be set through the Attribute tag.</td></tr>
+<tr><th>6</th><th>CheckBoxOption</th><th>Message</th><td>The attribute "<b>id</b>" may not be set through the Attribute tag.</td></tr>
+<tr><th>7</th><th>CheckBoxOption</th><th>Message</th><td>The attribute "<b>name</b>" may not be set through the Attribute tag.</td></tr>
 </table></div>
 
 </html>]]></ses:responseBody>
@@ -1061,7 +1064,8 @@
             
                 <span style="color:red;background-color:white">
  [<b>Tag Error:1</b>, Found in tag <b>RadioButtonOption</b>]</span>
-                <input type="radio" name="wlw-radio_button_group_key:{actionForm.theProperty}" value="Two" checked><span>Two</span>
+                <span style="color:red;background-color:white">
+ [<b>Tag Error:6</b>, Found in tag <b>RadioButtonOption</b>]</span>
                 <input type="radio" name="wlw-radio_button_group_key:{actionForm.theProperty}" value="Three"><span>Three</span>
             
             <input type="submit" value="submitIt">
@@ -1075,6 +1079,8 @@
 <tr><th>3</th><th>RadioButtonOption</th><th>Message</th><td>The attribute "<b>type</b>" may not be set through the Attribute tag.</td></tr>
 <tr><th>4</th><th>RadioButtonOption</th><th>Message</th><td>The attribute "<b>value</b>" may not be set through the Attribute tag.</td></tr>
 <tr><th>5</th><th>RadioButtonOption</th><th>Message</th><td>The attribute "<b>checked</b>" may not be set through the Attribute tag.</td></tr>
+<tr><th>6</th><th>RadioButtonOption</th><th>Message</th><td>The attribute "<b>id</b>" may not be set through the Attribute tag.</td></tr>
+<tr><th>7</th><th>RadioButtonOption</th><th>Message</th><td>The attribute "<b>name</b>" may not be set through the Attribute tag.</td></tr>
 </table></div>
 
 </html>]]></ses:responseBody>