lehoangel
14 Mar 2011, 10:50 PM
Hi I'm doing a simple login form. And this is the configuration for button [Login]
buttons: [{
text:'Login',
handler: function(){
loginForm.getForm().submit({
url: 'loginAction',
success: function(){
alert('success');
window.location = '/mfm/pages/loginAction';
},
failure: function(){
alert('fail');
}
});
}
}]The problem is the loginAction is configured using tiles & struts, like this:
<action name="loginAction" class="homeAction" method="login">
<result name="SUCCESS" type="tiles">homePage</result>
</action>When this action is called, it responses a html page, not a JSON type with a proper form like
{success: true, data: xxx}.
So, the failure function is called instead of success function.
I wonder if there is any way to make a suitable return in this case, or at least, make the extjs understand that it should run success function. :-?:-?:-?
Thanks.
buttons: [{
text:'Login',
handler: function(){
loginForm.getForm().submit({
url: 'loginAction',
success: function(){
alert('success');
window.location = '/mfm/pages/loginAction';
},
failure: function(){
alert('fail');
}
});
}
}]The problem is the loginAction is configured using tiles & struts, like this:
<action name="loginAction" class="homeAction" method="login">
<result name="SUCCESS" type="tiles">homePage</result>
</action>When this action is called, it responses a html page, not a JSON type with a proper form like
{success: true, data: xxx}.
So, the failure function is called instead of success function.
I wonder if there is any way to make a suitable return in this case, or at least, make the extjs understand that it should run success function. :-?:-?:-?
Thanks.