Why is the ajax:autocomplete dropdown not positioned correctly?

At present the ajax:autocomplete tag writes a DIV HTML element to the page to act as a placeholder for the dropdown or suggest list. Normally, you are free to put the ajax:autocomplete tag anywhere on the page (between the BODY tags).

However, if your page contains complex CSS positioning which surrounds the location of the ajax:autocomplete tag, you may get unexpected results. That is, the dropdown won't appear directly beneath the input field.

Solution: place the ajax:autocomplete tag outside any elements using CSS positioning, or simply the last element before the closing BODY tag. A future release of the tag library may resolve this issue.

Report courtesy of Keith Sherwood (Bright House Networks)

[top]


The ajax:callout tag requires a class definition. How do define a class for an element that already has a class assigned?

CSS allows you to assign multiple style classes to a single element. For example:

<a href="" class="linkStyle ajaxStyle otherStyle">Link to nowhere</a>

[top]


Can I include special characters in the AJAX XML response?

In short, yes you can. However, you must remember to properly encode the response sent back to the Ajax client. We recommend you set the XML encoding to UTF-8 or UTF-16 because to our knowledge, they are the only two encodings mandated by the XML spec. Also, it is wise to set the page encoding and character set on the response to match that set in the XML file.

For more information, see the following:

[top]


Are there any plans to add a validation tag?

No. There are currently no plans to support AJAX-based form validation. As with all open source, if anyone wants to contribute a solution, we're open to that possibility.

[top]


Why does the ajax:autocomplete tag submit the form when I press Enter to select a value from the list?

This is a known issue with the tag's JavaScript. The way in which the ajax:autocomplete tag binds itself to key events is a bit problematic. When you use the mouse to make a selection from the suggestion list, everything works properly. However, if you use the Enter key to make your selection, the enclosing HTML form will submit itself if a submit button is present. We know it's odd, but we just haven't been able to lick this problem.

Fortunately, we have a solution. Instead of using submit button, simply replace it with a button field and use the onclick event to submit the form.

For example:

<input type="button" value="Go" onclick="this.form.submit()" />

[top]


Why aren't my tags working with Struts forms?

Don't forget to set the styleId attribute.

<html:text property="myFormField" styleId="myFormField" />

[top]


Can I save having to write the XML on the server side?

There is a helper class to assist in building the XML if you don't want to do it by hand...see the Advanced Usage section for more information.

[top]


Why is Struts Validator breaking with AjaxTags/Prototype?

There appears to be a conflict between Struts' client-side validator and the Prototype framework. Essentially, Prototype extends the JavaScript Object class, which in turn breaks the way Struts Validator handles it's arrays. There is a workaround, but it has not been verified by the AjaxTags team. According to one user, you should add the following to every JavaScript validator:

for (x in oInteger) {
					if(x == 'extend') // Prototype Array() fix
					continue;
					var field = form[oInteger[x][0]];
					}

For a complete discussion of the problem, visit the following forum post.

[top]


How can I prevent the response from being cached on IE?

Several people have reported that their responses are being cached under IE, but not Firefox. To explicitly tell IE not to cache responses, you need to set a response header as follows in your servlet or JSP:

response.setHeader("Cache-Control", "no-cache");

[top]