
Originally Posted by
sbtourist
Have you verified that your validation works without that Ajax stuff?
It could be a problem in your validation code ... please post more of your code.
Yeah, it definitely works without it. It worked until I tried to do this via ajax. I'm using valang.
Code:
<bean id="loginValidator" class="org.springmodules.validation.valang.ValangValidator">
<property name="valang">
<value>
<![CDATA[
{ password : ? is not blank : 'Password must be specified'}
{ emailAddress : ? is not blank : 'Email Address must be specified'}
]]>
</value>
</property>
</bean>
and i've added the validator to my controller.
Code:
<property name="validator" ref="loginValidator" />
I'm using a redirect view in my controller, but even when i comment out my interceptor, the redirect does not work via ajax. It does call the controller that I'm redirecting to, but the page does not refresh. it did work from a non ajax call.

Originally Posted by
sbtourist
The DefaultValidationHandler will put there your error message, or redirect to your configured success view (don't forget the 'ajax-redirect' prefix in your configuration) if everything is ok.
Will this fix that problem? It will make the page refresh? I'm not sure where 'ajax-redirect' goes. The issue I'm trying to solve right now though, is how to get a handle on the returned response. My interceptor gives this debug statement:
Code:
2006-11-02 13:47:53,056 DEBUG xt.ajax.AjaxInterceptor::sendResponse(338) - Sending ajax response: <?xml version="1.0"?> <taconite-root xml:space="preserve"> <taconite-replace-children contextNodeID="password" parseInBrowser="true"></taconite-replace-children><taconite-replace-children contextNodeID="emailAddress" parseInBrowser="true"></taconite-replace-children><taconite-replace-children contextNodeID="password" parseInBrowser="true">Password must be specified</taconite-replace-children><taconite-execute-javascript parseInBrowser="true"><script type="text/javascript">new Effect.Highlight("password",{"startcolor":"#FF0A0A"});</script></taconite-execute-javascript><taconite-replace-children contextNodeID="emailAddress" parseInBrowser="true">Email Address must be specified</taconite-replace-children><taconite-execute-javascript parseInBrowser="true"><script type="text/javascript">new Effect.Highlight("emailAddress",{"startcolor":"#FF0A0A"});</script></taconite-execute-javascript> </taconite-root>
but when i view the firefox javascript console, i'm getting an error in springxt.js. I get the error contextNode has no properties in this function in springxt.js.
Code:
function getReplaceChildren(domNode,xml,doRemoveChildren) {
var domChildNode=null;
if(doRemoveChildren){
while(contextNode.childNodes.length >0){
contextNode.removeChild(contextNode.childNodes[0]);
}
}
for(var i=0;i<xml.childNodes.length;i++){
domChildNode=handleNode(xml.childNodes[i]);
if(domChildNode!=null) {
domNode.appendChild(domChildNode);
}
}
}
Not sure why I'm not getting a handle to the response. Thanks again for your help.