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.
We might have to implement a 'wakeup-waiting' state in events. And
that is sure to break some things.
We seem to have some events that really depend on event counts being
accurate, and other events that just need to know whether or not an
event happened. I don't think our event API necessarily guarantees
accurate counts...
On 2007-09-02, at 21:54 EDT, Henry Minsky wrote:
[I wanted to bring this to the whole team for discussion/consensus]
You bring up an issue that I've wondered about for a while; should a
dataset always send an ondata event in every case?
Currently, 'static' datasets (i.e. datasets with
compile-time-specified literal data) do not
send ondata events when they are initialized. I preserved this
behavior in LPS 4 from previous versions of LPS, but I was never sure
if that was the right semantics.
In the example you give, your dataset is 'static', i.e., it is not an
HTTP request or other dynamic loading of data. So it seems to me that
"doRequest()" method should not
really do anything at all. In this case, you could send the data
event manually, but that
seems like a kludge as well:
<dataset name="mydset" request="true">
<!-- oninit handler doesn't fire either -->
<handler name="oninit">
this.ondata.sendEvent(this.data);
</handler>
</dataset>
So maybe we should make all 'static' datasets send an ondata event
when they are initialized? Or make an explicit method which forces a
"ondata" event? I just am not sure
that overloading doRequest() is the right thing to do....
---------- Forwarded message ----------
From: Pablo Kang (JIRA) <[EMAIL PROTECTED]>
Date: Sep 2, 2007 5:45 PM
Subject: [JIRA] Created: (LPP-4632) Dataset doesn't send oninit event
To: [EMAIL PROTECTED]
Dataset doesn't send oninit event
---------------------------------
Key: LPP-4632
URL: http://www.openlaszlo.org/jira/browse/LPP-4632
Project: OpenLaszlo
Issue Type: Bug
Components: LFC - Data
Affects Versions: 4.0.3
Reporter: Pablo Kang
Assigned To: Henry Minsky
This in turn doesn't fire doRequest if request="true".
<canvas debug="true">
<handler name="oninit">
Debug.write('canvas init');
</handler>
<!-- request set to true but doRequest doesn't fire -->
</canvas>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the
administrators:
http://www.openlaszlo.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/
software/jira
--
Henry Minsky
Software Architect
[EMAIL PROTECTED]