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

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

    [ 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.