On 2007-09-03, at 09:41 EDT, Henry Minsky wrote:
On 9/3/07, P T Withington <[EMAIL PROTECTED]> wrote:
It would make sense to me that a static dataset would send an
'ondata' event at startup. It seems like a reasonable thing to
expect.
But. I bet that is going to raise the issue of what should happen if
someone sends an event and no one is listening. It is easy for me to
imagine that a static dataset might send this event before the
relevant listeners have been initialized sufficiently to be
listening.
I think that's what is happening, the startup for initialiazing the
dataset calls this routine
function setData( data , headers ) {
if ( data == null ) return;
if (data instanceof Array) {
this.setChildNodes( data );
} else {
this.setChildNodes( [data] );
}
this.data = data;
if ('responseheaders' in this && this.responseheaders != null) {
this.responseheaders.destroy();
}
this.responseheaders = headers;
if (this.ondata.ready) this.ondata.sendEvent( this );
}
And I suspect that the last line, "if (this.ondata.ready) " is
returning false because
some listener isn't set yet (what makes an event "ready"?)
Well I would propose a wakeup-waiting solution, but I think that is
too risky for Wafflecone. Note that implementing that would mean we
would lose Max's .ready optimization.