You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Vladimir Limansky (JIRA)" <ji...@apache.org> on 2008/04/09 23:07:05 UTC

[jira] Created: (WW-2585) AJAX validation does not work with sx:xxx dojo tags (javascript error)

AJAX validation does not work with sx:xxx dojo tags (javascript error)
----------------------------------------------------------------------

                 Key: WW-2585
                 URL: https://issues.apache.org/struts/browse/WW-2585
             Project: Struts 2
          Issue Type: Bug
          Components: Plugin - Dojo Tags
    Affects Versions: 2.1.0
         Environment: struts2-dojo-plugin-2.1.0.jar struts2-core-2.1.0.jar xwork-2.1.0.jar 
            Reporter: Vladimir Limansky


JSON data returned from the server can not be inserted correctly into the page content.

Let's examine the following code in validation.js (struts2-core-2.1.0.jar)

function addErrorXHTML(e, errorText) {
    try {
        // clear out any rows with an "errorFor" of e.id
        var row = e.parentNode.parentNode;
........
In case of 'normal' non-dojo field being validated (for instance s:textfield), the first parameter that is passed to this method (e) is <input type=text > so that for

<tr>
     <td>
            <input type="text" id="passed_field">
     </td>
</tr>

So e.parentNode.parentNode returns <tr> element so that we can insert error message just before it.
________________________________________________________________________________
Consider the same situation with (for instance sx:datetimepicker) tag. The content we have is as follows:
<tr>
     <td>
           <span>
                <input type=hidden/>
                <div ......./>
           <span>
     </td>
</tr>

So e.parentNode.parentNode will return <td> tag instead of expecting <tr> tag.


So this causes 3 problems:
1. Error messages are not cleaned
2. Error message arises in incorrect place
3. method addErrorXHTML shows alert message


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


[jira] Resolved: (WW-2585) AJAX validation does not work with sx:xxx dojo tags (javascript error)

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

Don Brown resolved WW-2585.
---------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.2

> AJAX validation does not work with sx:xxx dojo tags (javascript error)
> ----------------------------------------------------------------------
>
>                 Key: WW-2585
>                 URL: https://issues.apache.org/struts/browse/WW-2585
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>         Environment: struts2-dojo-plugin-2.1.0.jar struts2-core-2.1.0.jar xwork-2.1.0.jar 
>            Reporter: Vladimir Limansky
>             Fix For: 2.1.2
>
>
> JSON data returned from the server can not be inserted correctly into the page content.
> Let's examine the following code in validation.js (struts2-core-2.1.0.jar)
> function addErrorXHTML(e, errorText) {
>     try {
>         // clear out any rows with an "errorFor" of e.id
>         var row = e.parentNode.parentNode;
> ........
> In case of 'normal' non-dojo field being validated (for instance s:textfield), the first parameter that is passed to this method (e) is <input type=text > so that for
> <tr>
>      <td>
>             <input type="text" id="passed_field">
>      </td>
> </tr>
> So e.parentNode.parentNode returns <tr> element so that we can insert error message just before it.
> ________________________________________________________________________________
> Consider the same situation with (for instance sx:datetimepicker) tag. The content we have is as follows:
> <tr>
>      <td>
>            <span>
>                 <input type=hidden/>
>                 <div ......./>
>            <span>
>      </td>
> </tr>
> So e.parentNode.parentNode will return <td> tag instead of expecting <tr> tag.
> So this causes 3 problems:
> 1. Error messages are not cleaned
> 2. Error message arises in incorrect place
> 3. method addErrorXHTML shows alert message

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


[jira] Commented: (WW-2585) AJAX validation does not work with sx:xxx dojo tags (javascript error)

Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43637#action_43637 ] 

Jeromy Evans commented on WW-2585:
----------------------------------

I think WW-2256 and WW-2522 resolved this in 2.1.1.   

The parentNode.parentNode assumption was removed from validation.js and replaced with a search.

Thanks for the good description Vladimir.  Can you please confirm?

> AJAX validation does not work with sx:xxx dojo tags (javascript error)
> ----------------------------------------------------------------------
>
>                 Key: WW-2585
>                 URL: https://issues.apache.org/struts/browse/WW-2585
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>         Environment: struts2-dojo-plugin-2.1.0.jar struts2-core-2.1.0.jar xwork-2.1.0.jar 
>            Reporter: Vladimir Limansky
>
> JSON data returned from the server can not be inserted correctly into the page content.
> Let's examine the following code in validation.js (struts2-core-2.1.0.jar)
> function addErrorXHTML(e, errorText) {
>     try {
>         // clear out any rows with an "errorFor" of e.id
>         var row = e.parentNode.parentNode;
> ........
> In case of 'normal' non-dojo field being validated (for instance s:textfield), the first parameter that is passed to this method (e) is <input type=text > so that for
> <tr>
>      <td>
>             <input type="text" id="passed_field">
>      </td>
> </tr>
> So e.parentNode.parentNode returns <tr> element so that we can insert error message just before it.
> ________________________________________________________________________________
> Consider the same situation with (for instance sx:datetimepicker) tag. The content we have is as follows:
> <tr>
>      <td>
>            <span>
>                 <input type=hidden/>
>                 <div ......./>
>            <span>
>      </td>
> </tr>
> So e.parentNode.parentNode will return <td> tag instead of expecting <tr> tag.
> So this causes 3 problems:
> 1. Error messages are not cleaned
> 2. Error message arises in incorrect place
> 3. method addErrorXHTML shows alert message

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


[jira] Commented: (WW-2585) AJAX validation does not work with sx:xxx dojo tags (javascript error)

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43644#action_43644 ] 

Musachy Barroso commented on WW-2585:
-------------------------------------

I was looking at this ticket thinking, "this rings the bell". I think you are right Jeromy this was fixed in 2.1.

> AJAX validation does not work with sx:xxx dojo tags (javascript error)
> ----------------------------------------------------------------------
>
>                 Key: WW-2585
>                 URL: https://issues.apache.org/struts/browse/WW-2585
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>         Environment: struts2-dojo-plugin-2.1.0.jar struts2-core-2.1.0.jar xwork-2.1.0.jar 
>            Reporter: Vladimir Limansky
>
> JSON data returned from the server can not be inserted correctly into the page content.
> Let's examine the following code in validation.js (struts2-core-2.1.0.jar)
> function addErrorXHTML(e, errorText) {
>     try {
>         // clear out any rows with an "errorFor" of e.id
>         var row = e.parentNode.parentNode;
> ........
> In case of 'normal' non-dojo field being validated (for instance s:textfield), the first parameter that is passed to this method (e) is <input type=text > so that for
> <tr>
>      <td>
>             <input type="text" id="passed_field">
>      </td>
> </tr>
> So e.parentNode.parentNode returns <tr> element so that we can insert error message just before it.
> ________________________________________________________________________________
> Consider the same situation with (for instance sx:datetimepicker) tag. The content we have is as follows:
> <tr>
>      <td>
>            <span>
>                 <input type=hidden/>
>                 <div ......./>
>            <span>
>      </td>
> </tr>
> So e.parentNode.parentNode will return <td> tag instead of expecting <tr> tag.
> So this causes 3 problems:
> 1. Error messages are not cleaned
> 2. Error message arises in incorrect place
> 3. method addErrorXHTML shows alert message

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