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