Note |
---|
The ajax theme is experimental. Feedback is appreciateddeprecated! |
The ajax theme extends the xhtml theme with AJAX features. The theme uses the popular DOJO AJAX/JavaScript toolkit. AJAX features include:
...
The wrapping technique utilized by the ajax theme is much like xhtml theme, but the controlheader.ftl
is a wee bit different.
Code Block |
---|
<#if parameters.label?if_exists != "">
<#include "/${parameters.templateDir}/xhtml/controlheader.ftl" />
</#if>
<#if parameters.form?exists && parameters.form.validate?default(false) == true>
<#-- can't mutate the data model in freemarker -->
<#if parameters.onblur?exists>
${tag.addParameter('onblur', "validate(this);${parameters.onblur}")}
<#else>
${tag.addParameter('onblur', "validate(this);")}
</#if>
</#if>
|
Wiki Markup |
{snippet:id=all|lang=xml|url=struts2/plugins/dojo/src/main/resources/template/ajax/controlheader.ftl} |
The header provides for AJAX Client Side Validation by checking if the validate
attribute is set to true. If it is, a validation request is made on each onblur
event for a HTML Struts Tags. Some people don't like the onblur
behavior; they would rather a more advanced timer (say, 200ms) be kicked off after every keystroke. You can override this template and provide that type of behavior if you would like.
...