You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Don Brown (JIRA)" <ji...@apache.org> on 2008/06/13 03:26:06 UTC

[jira] Resolved: (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: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.