struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Limansky (JIRA)" <>
Subject [jira] Created: (WW-2585) AJAX validation does not work with sx:xxx dojo tags (javascript error)
Date Wed, 09 Apr 2008 21:07:05 GMT
AJAX validation does not work with sx:xxx dojo tags (javascript error)

                 Key: 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
        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

            <input type="text" id="passed_field">

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:
                <input type=hidden/>
                <div ......./>

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.

View raw message