Struts 2
  1. Struts 2
  2. WW-3804

tag s:radio does not support dynamic attributes

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.3
    • Fix Version/s: 2.3.7
    • Component/s: Plugin - Tags
    • Labels:

      Description

      The tag s:radio does not support dynamic attributes. As a result, integration with javascript frameworks like Dojo does not work (it's not possible to setup the attribute dojoType or data-dojo-type)

        Activity

        Jose L Martinez-Avial created issue -
        Hide
        Lukasz Lenart added a comment -

        Any specific needs ? I've added dynamic attributes support for s:radio tag and changed a bit logic for value to use ValueStack to look for a value or the use original value.

        Show
        Lukasz Lenart added a comment - Any specific needs ? I've added dynamic attributes support for s:radio tag and changed a bit logic for value to use ValueStack to look for a value or the use original value.
        Lukasz Lenart made changes -
        Field Original Value New Value
        Fix Version/s 2.3.4 [ 12320768 ]
        Lukasz Lenart made changes -
        Assignee Lukasz Lenart [ lukaszlenart ]
        Hide
        Jose L Martinez-Avial added a comment -

        well, just a quick question. When using HTML5 attributes (like data-dojo-props), would it be possible to use OGNL expression inside the value of the attribute. For example:

        <s:radio name="myRadio" list"myRadioList" data-dojo-type="dijit.form.RadioButton" data-dojo-props="checked: %

        {isChecked};"/>

        where %{isChecked}

        would be resovled against the vs. So, basically, it is possible to mix strings and ognl expression on the value?

        Show
        Jose L Martinez-Avial added a comment - well, just a quick question. When using HTML5 attributes (like data-dojo-props), would it be possible to use OGNL expression inside the value of the attribute. For example: <s:radio name="myRadio" list"myRadioList" data-dojo-type="dijit.form.RadioButton" data-dojo-props="checked: % {isChecked};"/> where %{isChecked} would be resovled against the vs. So, basically, it is possible to mix strings and ognl expression on the value?
        Hide
        Lukasz Lenart added a comment -

        Done, solved! Thanks for reporting!

        Added also support for expressions in values of dynamic attributes

        https://cwiki.apache.org/confluence/display/WW/Freemarker+Support

        Show
        Lukasz Lenart added a comment - Done, solved! Thanks for reporting! Added also support for expressions in values of dynamic attributes https://cwiki.apache.org/confluence/display/WW/Freemarker+Support
        Lukasz Lenart made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        Integrated in Struts2 #461 (See https://builds.apache.org/job/Struts2/461/)
        WW-3804 adds support of dynamic attributes to <s:radio/> tag and extends support for dynamic attributes with expression evaluation (Revision 1328526)

        Result = SUCCESS
        lukaszlenart :
        Files :

        • /struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/StrutsUtil.java
        • /struts/struts2/trunk/core/src/main/resources/template/simple/dynamic-attributes.ftl
        • /struts/struts2/trunk/core/src/main/resources/template/simple/radiomap.ftl
        • /struts/struts2/trunk/core/src/test/java/org/apache/struts2/util/StrutsUtilTest.java
        • /struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java
        • /struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Radio-7.txt
        Show
        Hudson added a comment - Integrated in Struts2 #461 (See https://builds.apache.org/job/Struts2/461/ ) WW-3804 adds support of dynamic attributes to <s:radio/> tag and extends support for dynamic attributes with expression evaluation (Revision 1328526) Result = SUCCESS lukaszlenart : Files : /struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/StrutsUtil.java /struts/struts2/trunk/core/src/main/resources/template/simple/dynamic-attributes.ftl /struts/struts2/trunk/core/src/main/resources/template/simple/radiomap.ftl /struts/struts2/trunk/core/src/test/java/org/apache/struts2/util/StrutsUtilTest.java /struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java /struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Radio-7.txt
        Lukasz Lenart made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Jon Moores added a comment -

        After downloading 2.3.4 this doesnt appear to be fixed. Did it make it to the 2.3.4 release ?

        Show
        Jon Moores added a comment - After downloading 2.3.4 this doesnt appear to be fixed. Did it make it to the 2.3.4 release ?
        Show
        Lukasz Lenart added a comment - Are you sure ? Check the test case http://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java https://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Radio-7.txt
        Hide
        Jon Moores added a comment -

        I havent run the test locally but I updated my struts jars to the new version and added the html below to my page:

        <tr>
        <td class="tdLabel"><label for="myname" class="label">mylabel:</label></td>
        <td>
        <s:radio name="myname" id="mynamehello" value="hello" list="#

        {'ALL': 'All Instructions'}

        " dojo="checked:hello"/><label for="mynamehello">world</label>
        <s:radio name="myname" id="mynamefoo" list="#

        {'ALL': 'All Instructions'}

        " value="foo" dojo="checked:foo"/><label for="mynamefoo">bar</label>
        </td>
        </tr>

        and I get the error. Also the docs for 2.3.4 explicitly say 'dynamic attributes allowed: false'

        Error Message:
        JSPG0227E: Exception caught while translating /tradingCentre/fund_orders.jsp: /tradingCentre/fund_orders.jsp(54,9) --> JSPG0123E: Unable to locate tag attribute info for tag attribute dojo.

        Show
        Jon Moores added a comment - I havent run the test locally but I updated my struts jars to the new version and added the html below to my page: <tr> <td class="tdLabel"><label for="myname" class="label">mylabel:</label></td> <td> <s:radio name="myname" id="mynamehello" value="hello" list="# {'ALL': 'All Instructions'} " dojo="checked:hello"/><label for="mynamehello">world</label> <s:radio name="myname" id="mynamefoo" list="# {'ALL': 'All Instructions'} " value="foo" dojo="checked:foo"/><label for="mynamefoo">bar</label> </td> </tr> and I get the error. Also the docs for 2.3.4 explicitly say 'dynamic attributes allowed: false' Error Message: JSPG0227E: Exception caught while translating /tradingCentre/fund_orders.jsp: /tradingCentre/fund_orders.jsp(54,9) --> JSPG0123E: Unable to locate tag attribute info for tag attribute dojo.
        Lukasz Lenart made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Lukasz Lenart made changes -
        Fix Version/s 2.3.5 [ 12321274 ]
        Fix Version/s 2.3.4 [ 12320768 ]
        Hide
        Lukasz Lenart added a comment -

        Solved, thanks for reporting!

        Show
        Lukasz Lenart added a comment - Solved, thanks for reporting!
        Lukasz Lenart made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        Integrated in Struts2 #504 (See https://builds.apache.org/job/Struts2/504/)
        WW-3804 enables Radio tag to use dynamic attributes (Revision 1364090)

        Result = FAILURE
        lukaszlenart :
        Files :

        • /struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Head.java
        • /struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Radio.java
        • /struts/struts2/trunk/core/src/site/resources/tags/head.html
        • /struts/struts2/trunk/core/src/site/resources/tags/radio.html
        Show
        Hudson added a comment - Integrated in Struts2 #504 (See https://builds.apache.org/job/Struts2/504/ ) WW-3804 enables Radio tag to use dynamic attributes (Revision 1364090) Result = FAILURE lukaszlenart : Files : /struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Head.java /struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Radio.java /struts/struts2/trunk/core/src/site/resources/tags/head.html /struts/struts2/trunk/core/src/site/resources/tags/radio.html
        Lukasz Lenart made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Lukasz Lenart made changes -
        Fix Version/s 2.3.6 [ 12323249 ]
        Fix Version/s 2.3.5 [ 12321274 ]
        Lukasz Lenart made changes -
        Fix Version/s 2.3.7 [ 12323448 ]
        Fix Version/s 2.3.6 [ 12323249 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        17h 36m 1 Lukasz Lenart 20/Apr/12 23:20
        Closed Closed Reopened Reopened
        30d 19h 32m 1 Lukasz Lenart 25/Jun/12 15:08
        Reopened Reopened Resolved Resolved
        25d 23h 31m 1 Lukasz Lenart 21/Jul/12 14:39
        Resolved Resolved Closed Closed
        110d 19h 13m 2 Lukasz Lenart 05/Oct/12 13:37

          People

          • Assignee:
            Lukasz Lenart
            Reporter:
            Jose L Martinez-Avial
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development