PDA

View Full Version : Direct Method not firing callback.



colin.jones
1 Oct 2009, 6:57 AM
I am making extensive use of Direct for both stores and arbitary function calls. I have noticed on occasion the callback functions of ad-hoc calls are not fired upon successful Direct-server interaction.

Unfortunately I do not have a cast iron fault-case. But have pin pointed the problem to the callback definition. After inspection of the transactions within the Ext.Direct singleton, I have noted that in some cases the cb property of the transaction is undefined. Furthermore if I manually set it after calling the function, it works!



users.addUser({
username:'Johnny',
forename:'Johnny',
surname:'Vegas'
},console.info);
// In some circumstances the callback is not registered, although the transaction
// is conducted successfully

Ext.Direct.getTransaction(Ext.Direct.TID).cb = console.info;
// this manual registration following the Direct call successfully makes
// the callback fire, when the transaction completes...
I'd be grateful if anyone could elaborate further, direct further debug or alert if the work-around is a cardinal sin.

Thanks, CJ

ThorstenSuckow
2 Oct 2009, 3:08 AM
Possibly related to http://www.extjs.com/forum/showthread.php?t=80379