Re: HTML5 DND and File Upload...

2010-01-22 Thread DaveC
I've got a little further (or a different error message) - running the
compiled code in Firefox 3.6 (as it supports the HTML5 File API) I get
the following Javascript Error...

"_FileReader_handlerManager is undefined" - I know nothing about
the mechanics of how GWT takes my Java Classes and turns them into
Javascript, but I do know that I'm creating the HandlerManager (in the
FileReader) as I can debug when I'm attaching the event handlers and
the handlerManager is being created and attaching the handler...

So can anyone help - as to why the instance of HandlerManager in
FileReader is undefined (which I think equates to null in GWT/Java
speak)?

Cheers,
Dave

On Jan 21, 4:49 pm, DaveC  wrote:
> OK,
>
> I've have a working implementation in IE, FF and Chrome (using Gears
> where necessary - GWT 2.0) that allows me to capture when a file is
> dragged from the desktop and dropped into the browser window.
>
> The next part of the puzzle is to grab the file data/content and
> upload it... grabbing the data is trivial when using the Gears
> implementation (as Gears creates a Blob as a property of the File -
> I've implemented my own GWT Gears API as the one on Google Code wasn't
> compatible with GWT 2).
>
> I've created a GWT implementation of the HTML5 File spec (FileList,
> FileError, File... etc) and have a FileReader that does the reading of
> the file in browsers that currently support the spec (Firefox 3.6)
>
> I've created a bunch of Handlers and Events for the FileReader
> (loadstart, loadend, progress etc) and I've added a HandlerManager to
> my FileReader class... and this is where things go wrong...
>
> The events come out of the Native (javascript) FileReader which calls
> (for instance) LoadStartEvent.fire() which gets all the way to the
> HandlerManager in the FileReader class and then a low level (JS) error
> is thrown... something like "cannot find static" it also appears
> to be not detectecting that (for instance) the event passed in is a
> LoadStartEvent - it just thinks it's a generic GwtEvent...
>
> My question is should I be using HandlerManager? Or is this only
> supposed to be for Widgets... I cannot believe that something like
> this is so hard/complicated to do in GWT/Java... when I have a fully
> working JS version (in a about 20 lines of code) - I'm trying to port
> to GWT for use inside an Enterprise B2B app...
>
> Please, are there any GWT engineers/experts listening that can (at
> least) point me in the right direction - I realise that there are
> probably NDAs relating to how to do this in GWT (because of the WAVE
> Client App) - but just a nod in the right direction would help...
>
> My intention is to open source all this once I've got something that
> works.
>
> Cheers,
> Dave

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



HTML5 DND and File Upload...

2010-01-21 Thread DaveC
OK,

I've have a working implementation in IE, FF and Chrome (using Gears
where necessary - GWT 2.0) that allows me to capture when a file is
dragged from the desktop and dropped into the browser window.

The next part of the puzzle is to grab the file data/content and
upload it... grabbing the data is trivial when using the Gears
implementation (as Gears creates a Blob as a property of the File -
I've implemented my own GWT Gears API as the one on Google Code wasn't
compatible with GWT 2).

I've created a GWT implementation of the HTML5 File spec (FileList,
FileError, File... etc) and have a FileReader that does the reading of
the file in browsers that currently support the spec (Firefox 3.6)

I've created a bunch of Handlers and Events for the FileReader
(loadstart, loadend, progress etc) and I've added a HandlerManager to
my FileReader class... and this is where things go wrong...

The events come out of the Native (javascript) FileReader which calls
(for instance) LoadStartEvent.fire() which gets all the way to the
HandlerManager in the FileReader class and then a low level (JS) error
is thrown... something like "cannot find static" it also appears
to be not detectecting that (for instance) the event passed in is a
LoadStartEvent - it just thinks it's a generic GwtEvent...

My question is should I be using HandlerManager? Or is this only
supposed to be for Widgets... I cannot believe that something like
this is so hard/complicated to do in GWT/Java... when I have a fully
working JS version (in a about 20 lines of code) - I'm trying to port
to GWT for use inside an Enterprise B2B app...

Please, are there any GWT engineers/experts listening that can (at
least) point me in the right direction - I realise that there are
probably NDAs relating to how to do this in GWT (because of the WAVE
Client App) - but just a nod in the right direction would help...

My intention is to open source all this once I've got something that
works.

Cheers,
Dave
-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.