It sounds great to me.  There won't be much change to what I'm doing now with the "before" advice.  Thanks!
 
On 2/3/06, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:
P.S. Just as with dojo, I would add the relevant information that people would need to the event object emitted. So, to get the responseElement it would be something like event.responseElement..Or event.responseText, etc..


On 2/3/06, Jesse Kuhnert <[EMAIL PROTECTED] > wrote:
I'd like to start moving away from the sort of hacky updateObject semantics I borrowed from prototype and move over to a cleaner dojo event model. In this model I would instead do something like :

define event emitter listening points on the tacos object instead...So I can add methods like this on the core tacos object

onRequestBegin()

onAjaxUpdate()

on<Whatever we want>

Then, the tacos _javascript_ logic will call these methods to emit events to anyone listening..

Then instead of passing in updateObject to everything you just add a dojo call like this:

dojo.event.connect(tacos, "onAjaxUpdate", doSomething(event) {

});

I think this model fits in nicely with how the eclipse rcp semantics work as well. Does everyone like this a little more?


On 2/3/06, Michael Waluk < [EMAIL PROTECTED]> wrote:
Hi Jesse,
 
What Cosmin would like (I think) is to be able to make a call to a _javascript_ function BEFORE the ajax call is made. That is a good time to put up a "processing" or "loading" message, etc.
 
I think what tacos provides (in alpha-7) for entry points in an udpateObject is
- beforeAjaxUpdate: called after the ajax response is received but before it is processed on the client
- ajaxUpdate:  called as each response element is processed, a chance to do something special for each updateComponent
- responseComplete:  a good time to hid the "processing" message 
 
I think adding a beforeAjaxRequest method would be really helpful so we could do things like put the "processing" message up.  What we are doing right now is connecting a method to get called before tacos.defaultLinkAction (see code example below), but it seems like the beforeAjaxRequest method on an updateObject would be a _nice_ new feature to add.  Maybe it could be called at the top of the defaultLinkAction or at a point where we could possibly cancel the ajax call if necessary?
 

function

connectWaitMethod() {

dojo.event.kwConnect({type: "before",

srcObj: tacos,

srcFunc:

"defaultLinkAction",

targetObj:

this,

targetFunc:

"showWait",

once:

true

}

);

}

dojo.addOnLoad(connectWaitMethod);
Hope that helps you Cosmin (the showWait method would be replaced by whatever you need).
 
- Michael
 



Reply via email to