You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Mike Calmus (JIRA)" <ji...@apache.org> on 2008/02/11 23:53:40 UTC

[jira] Created: (WW-2480) Some OGNL expressions do not work with DateTimePicker component (and possibly other)

Some OGNL expressions do not work with DateTimePicker component (and possibly other)
------------------------------------------------------------------------------------

                 Key: WW-2480
                 URL: https://issues.apache.org/struts/browse/WW-2480
             Project: Struts 2
          Issue Type: Bug
          Components: Plugin - Tags
    Affects Versions: 2.0.11
            Reporter: Mike Calmus


Certain expressions do not parse when using the DateTimePicker tag. This same expression works fine with the textfield tag:

The following line throws a parse exception.
        <s:datetimepicker name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
whereas this works fine:
        <s:textfield name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />

The problem seems to be that the latter uses the standard UIBean evaluateParams()  implementation whereas the former overrides it. This caused a problem with a third-party component as well. Based upon code usage, I believe this may affect other components as well. The following patch should fix both built-in as well as third-party modules:

Index: core/src/main/java/org/apache/struts2/components/UIBean.java
===================================================================
--- core/src/main/java/org/apache/struts2/components/UIBean.java        (revision 620628)
+++ core/src/main/java/org/apache/struts2/components/UIBean.java        (working copy)
@@ -588,8 +588,6 @@
         addParameter("templateDir", getTemplateDir());
         addParameter("theme", getTheme());

-        String name = null;
-
         if (this.key != null) {

            if(this.name == null) {
@@ -603,8 +601,8 @@
         }

         if (this.name != null) {
-            name = findString(this.name);
-            addParameter("name", name);
+            this.name = findString(this.name);
+            addParameter("name", this.name);
         }

         if (label != null) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2480) Some OGNL expressions do not work with DateTimePicker component

Posted by "Mike Calmus (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44003#action_44003 ] 

Mike Calmus commented on WW-2480:
---------------------------------

The UIBena parent class does the following:

        String name = null;
        String providedLabel = null;

        if (this.key != null) {

            if(this.name == null) {
                this.name = key;
            }

            if(this.label == null) {
                // lookup the label from a TextProvider (default value is the key)
                providedLabel = TextProviderHelper.getText(key, key, stack);
            }

        }

        if (this.name != null) {
            name = findString(this.name);
            addParameter("name", name);
        }

As you can see the "name" that gets put into the value map is different than the value stored for the class member variable. The key here is that we need name after it has been run through the findString method. I did the change to DateTimePicker because I figured there must be some reason for this behavior and didn't want to take a chance on breaking something elsewhere by changing UIBean itself.

> Some OGNL expressions do not work with DateTimePicker component
> ---------------------------------------------------------------
>
>                 Key: WW-2480
>                 URL: https://issues.apache.org/struts/browse/WW-2480
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.0.11, 2.0.11.1, 2.0.12, 2.1.0, 2.1.1
>            Reporter: Mike Calmus
>            Priority: Blocker
>
> Certain expressions do not parse when using the DateTimePicker tag. This same expression works fine with the textfield tag:
> The following line throws a parse exception.
>         <s:datetimepicker name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> whereas this works fine:
>         <s:textfield name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> The problem seems to be that the latter uses the standard UIBean evaluateParams()  implementation whereas the former overrides it. This caused a problem with a third-party component as well. Based upon code usage, I believe this may affect other components as well. The following patch should fix both built-in as well as third-party modules:
> Index: core/src/main/java/org/apache/struts2/components/UIBean.java
> ===================================================================
> --- core/src/main/java/org/apache/struts2/components/UIBean.java        (revision 620628)
> +++ core/src/main/java/org/apache/struts2/components/UIBean.java        (working copy)
> @@ -588,8 +588,6 @@
>          addParameter("templateDir", getTemplateDir());
>          addParameter("theme", getTheme());
> -        String name = null;
> -
>          if (this.key != null) {
>             if(this.name == null) {
> @@ -603,8 +601,8 @@
>          }
>          if (this.name != null) {
> -            name = findString(this.name);
> -            addParameter("name", name);
> +            this.name = findString(this.name);
> +            addParameter("name", this.name);
>          }
>          if (label != null) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WW-2480) Some OGNL expressions do not work with DateTimePicker component

Posted by "Rainer Hermanns (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rainer Hermanns resolved WW-2480.
---------------------------------

    Resolution: Fixed

Patch applied to svn trunk, thanks!

> Some OGNL expressions do not work with DateTimePicker component
> ---------------------------------------------------------------
>
>                 Key: WW-2480
>                 URL: https://issues.apache.org/struts/browse/WW-2480
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.0.11, 2.0.11.1, 2.0.12, 2.1.0, 2.1.1
>            Reporter: Mike Calmus
>            Assignee: Rainer Hermanns
>             Fix For: 2.1.3
>
>
> Certain expressions do not parse when using the DateTimePicker tag. This same expression works fine with the textfield tag:
> The following line throws a parse exception.
>         <s:datetimepicker name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> whereas this works fine:
>         <s:textfield name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> The problem seems to be that the latter uses the standard UIBean evaluateParams()  implementation whereas the former overrides it. This caused a problem with a third-party component as well. Based upon code usage, I believe this may affect other components as well. The following patch should fix both built-in as well as third-party modules:
> Index: core/src/main/java/org/apache/struts2/components/UIBean.java
> ===================================================================
> --- core/src/main/java/org/apache/struts2/components/UIBean.java        (revision 620628)
> +++ core/src/main/java/org/apache/struts2/components/UIBean.java        (working copy)
> @@ -588,8 +588,6 @@
>          addParameter("templateDir", getTemplateDir());
>          addParameter("theme", getTheme());
> -        String name = null;
> -
>          if (this.key != null) {
>             if(this.name == null) {
> @@ -603,8 +601,8 @@
>          }
>          if (this.name != null) {
> -            name = findString(this.name);
> -            addParameter("name", name);
> +            this.name = findString(this.name);
> +            addParameter("name", this.name);
>          }
>          if (label != null) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2480) Some OGNL expressions do not work with DateTimePicker component

Posted by "Mike Calmus (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Calmus updated WW-2480:
----------------------------

    Summary: Some OGNL expressions do not work with DateTimePicker component  (was: Some OGNL expressions do not work with DateTimePicker component (and possibly other))

> Some OGNL expressions do not work with DateTimePicker component
> ---------------------------------------------------------------
>
>                 Key: WW-2480
>                 URL: https://issues.apache.org/struts/browse/WW-2480
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tags
>    Affects Versions: 2.0.11
>            Reporter: Mike Calmus
>
> Certain expressions do not parse when using the DateTimePicker tag. This same expression works fine with the textfield tag:
> The following line throws a parse exception.
>         <s:datetimepicker name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> whereas this works fine:
>         <s:textfield name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> The problem seems to be that the latter uses the standard UIBean evaluateParams()  implementation whereas the former overrides it. This caused a problem with a third-party component as well. Based upon code usage, I believe this may affect other components as well. The following patch should fix both built-in as well as third-party modules:
> Index: core/src/main/java/org/apache/struts2/components/UIBean.java
> ===================================================================
> --- core/src/main/java/org/apache/struts2/components/UIBean.java        (revision 620628)
> +++ core/src/main/java/org/apache/struts2/components/UIBean.java        (working copy)
> @@ -588,8 +588,6 @@
>          addParameter("templateDir", getTemplateDir());
>          addParameter("theme", getTheme());
> -        String name = null;
> -
>          if (this.key != null) {
>             if(this.name == null) {
> @@ -603,8 +601,8 @@
>          }
>          if (this.name != null) {
> -            name = findString(this.name);
> -            addParameter("name", name);
> +            this.name = findString(this.name);
> +            addParameter("name", this.name);
>          }
>          if (label != null) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2480) Some OGNL expressions do not work with DateTimePicker component

Posted by "Mike Calmus (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Calmus updated WW-2480:
----------------------------

          Component/s:     (was: Plugin - Tags)
                       Plugin - Dojo Tags
    Affects Version/s: 2.1.1
                       2.0.12
                       2.0.11.1
                       2.1.0

This is also an issue in 2.1.x

> Some OGNL expressions do not work with DateTimePicker component
> ---------------------------------------------------------------
>
>                 Key: WW-2480
>                 URL: https://issues.apache.org/struts/browse/WW-2480
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.0.11, 2.0.11.1, 2.0.12, 2.1.0, 2.1.1
>            Reporter: Mike Calmus
>
> Certain expressions do not parse when using the DateTimePicker tag. This same expression works fine with the textfield tag:
> The following line throws a parse exception.
>         <s:datetimepicker name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> whereas this works fine:
>         <s:textfield name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> The problem seems to be that the latter uses the standard UIBean evaluateParams()  implementation whereas the former overrides it. This caused a problem with a third-party component as well. Based upon code usage, I believe this may affect other components as well. The following patch should fix both built-in as well as third-party modules:
> Index: core/src/main/java/org/apache/struts2/components/UIBean.java
> ===================================================================
> --- core/src/main/java/org/apache/struts2/components/UIBean.java        (revision 620628)
> +++ core/src/main/java/org/apache/struts2/components/UIBean.java        (working copy)
> @@ -588,8 +588,6 @@
>          addParameter("templateDir", getTemplateDir());
>          addParameter("theme", getTheme());
> -        String name = null;
> -
>          if (this.key != null) {
>             if(this.name == null) {
> @@ -603,8 +601,8 @@
>          }
>          if (this.name != null) {
> -            name = findString(this.name);
> -            addParameter("name", name);
> +            this.name = findString(this.name);
> +            addParameter("name", this.name);
>          }
>          if (label != null) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2480) Some OGNL expressions do not work with DateTimePicker component

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43998#action_43998 ] 

James Holmes commented on WW-2480:
----------------------------------

The DateTimePicker component has been moved out of Struts 2 core and into the new Dojo plugin. Your patch to the DateTimePicker class no longer applies as the code is different now. Can you confirm that this is still an issue with Struts 2.1.2 beta? If so, please provide another patch and I will review it and commit it.

> Some OGNL expressions do not work with DateTimePicker component
> ---------------------------------------------------------------
>
>                 Key: WW-2480
>                 URL: https://issues.apache.org/struts/browse/WW-2480
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.0.11, 2.0.11.1, 2.0.12, 2.1.0, 2.1.1
>            Reporter: Mike Calmus
>            Priority: Blocker
>
> Certain expressions do not parse when using the DateTimePicker tag. This same expression works fine with the textfield tag:
> The following line throws a parse exception.
>         <s:datetimepicker name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> whereas this works fine:
>         <s:textfield name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> The problem seems to be that the latter uses the standard UIBean evaluateParams()  implementation whereas the former overrides it. This caused a problem with a third-party component as well. Based upon code usage, I believe this may affect other components as well. The following patch should fix both built-in as well as third-party modules:
> Index: core/src/main/java/org/apache/struts2/components/UIBean.java
> ===================================================================
> --- core/src/main/java/org/apache/struts2/components/UIBean.java        (revision 620628)
> +++ core/src/main/java/org/apache/struts2/components/UIBean.java        (working copy)
> @@ -588,8 +588,6 @@
>          addParameter("templateDir", getTemplateDir());
>          addParameter("theme", getTheme());
> -        String name = null;
> -
>          if (this.key != null) {
>             if(this.name == null) {
> @@ -603,8 +601,8 @@
>          }
>          if (this.name != null) {
> -            name = findString(this.name);
> -            addParameter("name", name);
> +            this.name = findString(this.name);
> +            addParameter("name", this.name);
>          }
>          if (label != null) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2480) Some OGNL expressions do not work with DateTimePicker component

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44000#action_44000 ] 

James Holmes commented on WW-2480:
----------------------------------

I'm confused as to why there is a need to explicitly get the "name" parameter from the parameters map. How is that value going to be different than the value that is set on the component via the setName() method.

Just trying to understand this more and the ramifications of the change before I commit the code.

> Some OGNL expressions do not work with DateTimePicker component
> ---------------------------------------------------------------
>
>                 Key: WW-2480
>                 URL: https://issues.apache.org/struts/browse/WW-2480
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.0.11, 2.0.11.1, 2.0.12, 2.1.0, 2.1.1
>            Reporter: Mike Calmus
>            Priority: Blocker
>
> Certain expressions do not parse when using the DateTimePicker tag. This same expression works fine with the textfield tag:
> The following line throws a parse exception.
>         <s:datetimepicker name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> whereas this works fine:
>         <s:textfield name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> The problem seems to be that the latter uses the standard UIBean evaluateParams()  implementation whereas the former overrides it. This caused a problem with a third-party component as well. Based upon code usage, I believe this may affect other components as well. The following patch should fix both built-in as well as third-party modules:
> Index: core/src/main/java/org/apache/struts2/components/UIBean.java
> ===================================================================
> --- core/src/main/java/org/apache/struts2/components/UIBean.java        (revision 620628)
> +++ core/src/main/java/org/apache/struts2/components/UIBean.java        (working copy)
> @@ -588,8 +588,6 @@
>          addParameter("templateDir", getTemplateDir());
>          addParameter("theme", getTheme());
> -        String name = null;
> -
>          if (this.key != null) {
>             if(this.name == null) {
> @@ -603,8 +601,8 @@
>          }
>          if (this.name != null) {
> -            name = findString(this.name);
> -            addParameter("name", name);
> +            this.name = findString(this.name);
> +            addParameter("name", this.name);
>          }
>          if (label != null) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2480) Some OGNL expressions do not work with DateTimePicker component

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Don Brown updated WW-2480:
--------------------------

         Priority: Major  (was: Blocker)
    Fix Version/s: 2.1.3

> Some OGNL expressions do not work with DateTimePicker component
> ---------------------------------------------------------------
>
>                 Key: WW-2480
>                 URL: https://issues.apache.org/struts/browse/WW-2480
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.0.11, 2.0.11.1, 2.0.12, 2.1.0, 2.1.1
>            Reporter: Mike Calmus
>             Fix For: 2.1.3
>
>
> Certain expressions do not parse when using the DateTimePicker tag. This same expression works fine with the textfield tag:
> The following line throws a parse exception.
>         <s:datetimepicker name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> whereas this works fine:
>         <s:textfield name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> The problem seems to be that the latter uses the standard UIBean evaluateParams()  implementation whereas the former overrides it. This caused a problem with a third-party component as well. Based upon code usage, I believe this may affect other components as well. The following patch should fix both built-in as well as third-party modules:
> Index: core/src/main/java/org/apache/struts2/components/UIBean.java
> ===================================================================
> --- core/src/main/java/org/apache/struts2/components/UIBean.java        (revision 620628)
> +++ core/src/main/java/org/apache/struts2/components/UIBean.java        (working copy)
> @@ -588,8 +588,6 @@
>          addParameter("templateDir", getTemplateDir());
>          addParameter("theme", getTheme());
> -        String name = null;
> -
>          if (this.key != null) {
>             if(this.name == null) {
> @@ -603,8 +601,8 @@
>          }
>          if (this.name != null) {
> -            name = findString(this.name);
> -            addParameter("name", name);
> +            this.name = findString(this.name);
> +            addParameter("name", this.name);
>          }
>          if (label != null) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WW-2480) Some OGNL expressions do not work with DateTimePicker component

Posted by "Rainer Hermanns (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rainer Hermanns reassigned WW-2480:
-----------------------------------

    Assignee: Rainer Hermanns

> Some OGNL expressions do not work with DateTimePicker component
> ---------------------------------------------------------------
>
>                 Key: WW-2480
>                 URL: https://issues.apache.org/struts/browse/WW-2480
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.0.11, 2.0.11.1, 2.0.12, 2.1.0, 2.1.1
>            Reporter: Mike Calmus
>            Assignee: Rainer Hermanns
>             Fix For: 2.1.3
>
>
> Certain expressions do not parse when using the DateTimePicker tag. This same expression works fine with the textfield tag:
> The following line throws a parse exception.
>         <s:datetimepicker name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> whereas this works fine:
>         <s:textfield name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> The problem seems to be that the latter uses the standard UIBean evaluateParams()  implementation whereas the former overrides it. This caused a problem with a third-party component as well. Based upon code usage, I believe this may affect other components as well. The following patch should fix both built-in as well as third-party modules:
> Index: core/src/main/java/org/apache/struts2/components/UIBean.java
> ===================================================================
> --- core/src/main/java/org/apache/struts2/components/UIBean.java        (revision 620628)
> +++ core/src/main/java/org/apache/struts2/components/UIBean.java        (working copy)
> @@ -588,8 +588,6 @@
>          addParameter("templateDir", getTemplateDir());
>          addParameter("theme", getTheme());
> -        String name = null;
> -
>          if (this.key != null) {
>             if(this.name == null) {
> @@ -603,8 +601,8 @@
>          }
>          if (this.name != null) {
> -            name = findString(this.name);
> -            addParameter("name", name);
> +            this.name = findString(this.name);
> +            addParameter("name", this.name);
>          }
>          if (label != null) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2480) Some OGNL expressions do not work with DateTimePicker component

Posted by "Mike Calmus (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43999#action_43999 ] 

Mike Calmus commented on WW-2480:
---------------------------------

Here's the 2.1.x patch.

Index: dojo/src/main/java/org/apache/struts2/dojo/components/DateTimePicker.java
===================================================================
--- dojo/src/main/java/org/apache/struts2/dojo/components/DateTimePicker.java   (revision 661885)
+++ dojo/src/main/java/org/apache/struts2/dojo/components/DateTimePicker.java   (working copy)
@@ -22,7 +22,6 @@
 package org.apache.struts2.dojo.components;

 import java.text.DateFormat;
-import java.text.Format;
 import java.text.MessageFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -256,12 +255,12 @@
         if(valueNotifyTopics != null)
             addParameter("valueNotifyTopics", findString(valueNotifyTopics));

-        // format the value to RFC 3399
+        // format the value to RFC 3339
         if(parameters.containsKey("value")) {
-            parameters.put("nameValue", parameters.get("value"));
+            addParameter("nameValue", parameters.get("value"));
         } else {
-            if(name != null) {
-                addParameter("nameValue", format(findValue(name)));
+            if(parameters.containsKey("name")) {
+                addParameter("nameValue", format(findValue((String)parameters.get("name"))));
             }
         }


> Some OGNL expressions do not work with DateTimePicker component
> ---------------------------------------------------------------
>
>                 Key: WW-2480
>                 URL: https://issues.apache.org/struts/browse/WW-2480
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.0.11, 2.0.11.1, 2.0.12, 2.1.0, 2.1.1
>            Reporter: Mike Calmus
>            Priority: Blocker
>
> Certain expressions do not parse when using the DateTimePicker tag. This same expression works fine with the textfield tag:
> The following line throws a parse exception.
>         <s:datetimepicker name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> whereas this works fine:
>         <s:textfield name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> The problem seems to be that the latter uses the standard UIBean evaluateParams()  implementation whereas the former overrides it. This caused a problem with a third-party component as well. Based upon code usage, I believe this may affect other components as well. The following patch should fix both built-in as well as third-party modules:
> Index: core/src/main/java/org/apache/struts2/components/UIBean.java
> ===================================================================
> --- core/src/main/java/org/apache/struts2/components/UIBean.java        (revision 620628)
> +++ core/src/main/java/org/apache/struts2/components/UIBean.java        (working copy)
> @@ -588,8 +588,6 @@
>          addParameter("templateDir", getTemplateDir());
>          addParameter("theme", getTheme());
> -        String name = null;
> -
>          if (this.key != null) {
>             if(this.name == null) {
> @@ -603,8 +601,8 @@
>          }
>          if (this.name != null) {
> -            name = findString(this.name);
> -            addParameter("name", name);
> +            this.name = findString(this.name);
> +            addParameter("name", this.name);
>          }
>          if (label != null) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2480) Some OGNL expressions do not work with DateTimePicker component (and possibly other)

Posted by "Mike Calmus (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43553#action_43553 ] 

Mike Calmus commented on WW-2480:
---------------------------------

Perhaps this patch would be more favorable:

Index: src/main/java/org/apache/struts2/components/DateTimePicker.java
===================================================================
--- src/main/java/org/apache/struts2/components/DateTimePicker.java     (revision 641326)
+++ src/main/java/org/apache/struts2/components/DateTimePicker.java     (working copy)
@@ -201,8 +201,8 @@
         if(parameters.containsKey("value")) {
             parameters.put("nameValue", format(parameters.get("value")));
         } else {
-            if(name != null) {
-                String expr = name;
+            if(parameters.containsKey("name")) {
+                String expr = (String)parameters.get("name");
                 if(altSyntax()) {
                     expr = "%{" + expr + "}";
                 }

> Some OGNL expressions do not work with DateTimePicker component (and possibly other)
> ------------------------------------------------------------------------------------
>
>                 Key: WW-2480
>                 URL: https://issues.apache.org/struts/browse/WW-2480
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tags
>    Affects Versions: 2.0.11
>            Reporter: Mike Calmus
>
> Certain expressions do not parse when using the DateTimePicker tag. This same expression works fine with the textfield tag:
> The following line throws a parse exception.
>         <s:datetimepicker name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> whereas this works fine:
>         <s:textfield name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> The problem seems to be that the latter uses the standard UIBean evaluateParams()  implementation whereas the former overrides it. This caused a problem with a third-party component as well. Based upon code usage, I believe this may affect other components as well. The following patch should fix both built-in as well as third-party modules:
> Index: core/src/main/java/org/apache/struts2/components/UIBean.java
> ===================================================================
> --- core/src/main/java/org/apache/struts2/components/UIBean.java        (revision 620628)
> +++ core/src/main/java/org/apache/struts2/components/UIBean.java        (working copy)
> @@ -588,8 +588,6 @@
>          addParameter("templateDir", getTemplateDir());
>          addParameter("theme", getTheme());
> -        String name = null;
> -
>          if (this.key != null) {
>             if(this.name == null) {
> @@ -603,8 +601,8 @@
>          }
>          if (this.name != null) {
> -            name = findString(this.name);
> -            addParameter("name", name);
> +            this.name = findString(this.name);
> +            addParameter("name", this.name);
>          }
>          if (label != null) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2480) Some OGNL expressions do not work with DateTimePicker component

Posted by "Mike Calmus (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Calmus updated WW-2480:
----------------------------

    Priority: Blocker  (was: Major)

> Some OGNL expressions do not work with DateTimePicker component
> ---------------------------------------------------------------
>
>                 Key: WW-2480
>                 URL: https://issues.apache.org/struts/browse/WW-2480
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.0.11, 2.0.11.1, 2.0.12, 2.1.0, 2.1.1
>            Reporter: Mike Calmus
>            Priority: Blocker
>
> Certain expressions do not parse when using the DateTimePicker tag. This same expression works fine with the textfield tag:
> The following line throws a parse exception.
>         <s:datetimepicker name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> whereas this works fine:
>         <s:textfield name="aList.get(%{#attr['item_rowNum'] - 1}).startDate" />
> The problem seems to be that the latter uses the standard UIBean evaluateParams()  implementation whereas the former overrides it. This caused a problem with a third-party component as well. Based upon code usage, I believe this may affect other components as well. The following patch should fix both built-in as well as third-party modules:
> Index: core/src/main/java/org/apache/struts2/components/UIBean.java
> ===================================================================
> --- core/src/main/java/org/apache/struts2/components/UIBean.java        (revision 620628)
> +++ core/src/main/java/org/apache/struts2/components/UIBean.java        (working copy)
> @@ -588,8 +588,6 @@
>          addParameter("templateDir", getTemplateDir());
>          addParameter("theme", getTheme());
> -        String name = null;
> -
>          if (this.key != null) {
>             if(this.name == null) {
> @@ -603,8 +601,8 @@
>          }
>          if (this.name != null) {
> -            name = findString(this.name);
> -            addParameter("name", name);
> +            this.name = findString(this.name);
> +            addParameter("name", this.name);
>          }
>          if (label != null) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.