[Laszlo-dev] Fwd: [JIRA] Created: (LPP-4632) Dataset, doesn't send oninit event
André Bargull
a.bargull at intensis.de
Tue Sep 4 12:23:56 PDT 2007
What about waiting for canvas-"oninit" before sending the "ondata"-Event
of a static dataset? That'd one of the easiest solutions to guarantee
that every listener is fully initialized.
P T Withington wrote:
> On 2007-09-03, at 09:41 EDT, Henry Minsky wrote:
>> On 9/3/07, P T Withington <ptw at openlaszlo.org> 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.
--
Official OpenLaszlo-Committer ^_^
More information about the Laszlo-dev
mailing list