+1
It would be a mess if you would keep the both approaches side-by-side.

However they could be kept side-by-side by making the events all lowercase like oncancel etc. (that seems to be laszlo standard)
Also I am not sure but do event names and method names collide?
Aren't events kept in their own array or something?

Further the two approaches could be nicely put into separate files if <include type="text"/> would work ;-)
<class name="fileupload">
<!-- deprecated event handlers (methods) -->
<include type="text" href="deprecatedEventHandlerMethods"/>
<!-- events -->
<include type="text" href="deprecatedEventHandlerMethods"/>
</class>

Is this called double-talk?
+1 for whatever you choose, then :-)

- rami

23.1.2010 2:05, Antun Karlovac kirjoitti:
Hi all,

The fileupload component in the incubator has a wonky non-OpenLaszlo-like API for listening for responses. In OpenLaszlo, when you're working with a class that makes HTTP (or other asynchronous activities), you do:

<dataset name="myData" src="http:path/to/data.jsp">
<handler name="ondata">
        // Now you know the response has arrived.
</handler>
</dataset>

This approach provides lots of flexibility - you can use delegates to listen for the event if necessary, and handlers can be anywhere.

However, the fileupload component requires the developer to override a method. e.g.

<fileupload>
<method name="onComplete">
        // Now you know your file has been uploaded.
</method>
</fileupload>

This isn't laszlo-y at all.

I recently filed LPP-8729 against the fileupload component to represent this problem. I'm volunteering to fix this, but it would involve a change to the API of fileupload.

**THE CHANGE**
Instead of writing:
<fileupload>
<method name="onComplete">
        // Now you know your file has been uploaded.
</method>
</fileupload>

... you would write:
<fileupload>
<handler name="onComplete">
        // Now you know your file has been uploaded.
</handler>
</fileupload>

Since the method names unfortunately begin with "on", the two approaches couldn't run concurrently. It would have to be an overnight change.

Does anyone object to this?

-Antun

Reply via email to