PDA

View Full Version : send response to Connection request



daneseale
7 Jul 2010, 6:59 AM
Hello,
I have this problem:

my application does this Connection:

[Client]
var conn = new Ext.data.Connection();
conn.request({
url: 'addUsers.action',
params: {
action: 'add',
id: text
},
success: function (resp, opt) {
Ext.Msd.alert("ok", "ok");
},
failure: function(resp, opt) {
Ext.Msg.alert('Error', 'Error');
}
});

[Server]
<%@page contentType="text/html" pageEncoding="UTF-8"%>
{
success:<%= request.getAttribute("actionEsit")%>,
data: 'not well'
}

The message from server is:
{success:false, data: 'not well'}

now, i see a message dialog window with text "ok".
How is it possible ? the variable success is equals to false,
why i not see the message "Error" ? :((

Please help me.
Thanks for your time. byee byee

7 Jul 2010, 7:41 AM
With Ext JS Ajax, any non-fatal return code (200's), is considered a successful request. Do not get Ext JS BasicForm Submit action return validation confused with Ext JS ajax requests.

7 Jul 2010, 7:41 AM
Moved to Ext Help. Please post related help questions here.

daneseale
7 Jul 2010, 7:59 AM
ok, i forgot this difference. :D
now i understand because i didn't see what i expected

thank you.