Discussion:
Wicket and file upload with blueimp jquery file upload
heapifyman
2012-10-16 10:49:00 UTC
Permalink
Hello,

has anyone tried yet to integrate blueimp's jQuery File Upload
http://blueimp.github.com/jQuery-File-Upload/ with Wicket FileUpload?
Especially in combination with additional input fields <input type=text">
I'm kind of stuck because I'm not really sure where to point the jquery
file upload's url param to and how to store the uploaded files in the
wicket page for saving them when the complete form is submitted.

Any help would be appreciated.
Thanks
Martin Grigorov
2012-10-16 10:54:10 UTC
Permalink
Hi,

Is it an option to upload to a IResource and store the uploaded data
the same way as if you'd do in the page ?
Post by heapifyman
Hello,
has anyone tried yet to integrate blueimp's jQuery File Upload
http://blueimp.github.com/jQuery-File-Upload/ with Wicket FileUpload?
Especially in combination with additional input fields <input type=text">
I'm kind of stuck because I'm not really sure where to point the jquery
file upload's url param to and how to store the uploaded files in the
wicket page for saving them when the complete form is submitted.
Any help would be appreciated.
Thanks
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
heapifyman
2012-10-16 10:59:57 UTC
Permalink
Not sure if I understand.
As far as I got it, the upload plugin requires some "web service" that
accepts POST and DELETE requests to add/remove uploaded files.
Doing that is no problem, I guess.
But how to I link this with the current user's wicket session so that I
know which files the users uploaded when finally the form is submitted?
I'm not sure if I'm using the right wording here. Hope you get the idea...
Post by Martin Grigorov
Hi,
Is it an option to upload to a IResource and store the uploaded data
the same way as if you'd do in the page ?
Post by heapifyman
Hello,
has anyone tried yet to integrate blueimp's jQuery File Upload
http://blueimp.github.com/jQuery-File-Upload/ with Wicket FileUpload?
Especially in combination with additional input fields <input type=text">
I'm kind of stuck because I'm not really sure where to point the jquery
file upload's url param to and how to store the uploaded files in the
wicket page for saving them when the complete form is submitted.
Any help would be appreciated.
Thanks
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
---------------------------------------------------------------------
Bas Gooren
2012-10-16 16:51:52 UTC
Permalink
Hi!

We use a different uploader (uploadify), but the basics are the same.

What we've built for this is a behavior which renders the UI for the
uploader, and handles ajax callbacks.

The uploader uploads to a mounted resource (e.g. at /uploadify), which
has an internal cache (UUID => FileInfo).
After a successful upload, the upload resource returns the UUID;
The javascript onComplete handler then calls the ajax behavior with the
UUID parameter, which allows other components in the page to respond to
the upload.

To prevent overflow in the uploader cache we use a map with a maximum
size which evicts old entries on overflow.

Met vriendelijke groet,
Kind regards,

Bas Gooren
Post by heapifyman
Not sure if I understand.
As far as I got it, the upload plugin requires some "web service" that
accepts POST and DELETE requests to add/remove uploaded files.
Doing that is no problem, I guess.
But how to I link this with the current user's wicket session so that I
know which files the users uploaded when finally the form is submitted?
I'm not sure if I'm using the right wording here. Hope you get the idea...
Post by Martin Grigorov
Hi,
Is it an option to upload to a IResource and store the uploaded data
the same way as if you'd do in the page ?
Post by heapifyman
Hello,
has anyone tried yet to integrate blueimp's jQuery File Upload
http://blueimp.github.com/jQuery-File-Upload/ with Wicket FileUpload?
Especially in combination with additional input fields <input type=text">
I'm kind of stuck because I'm not really sure where to point the jquery
file upload's url param to and how to store the uploaded files in the
wicket page for saving them when the complete form is submitted.
Any help would be appreciated.
Thanks
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
---------------------------------------------------------------------
heapifyman
2012-10-16 17:09:30 UTC
Permalink
Thanks.
Would you mind sharing the mounted resource's code? I'm not completely sure
how to implement that.
Post by Bas Gooren
Hi!
We use a different uploader (uploadify), but the basics are the same.
What we've built for this is a behavior which renders the UI for the
uploader, and handles ajax callbacks.
The uploader uploads to a mounted resource (e.g. at /uploadify), which has
an internal cache (UUID => FileInfo).
After a successful upload, the upload resource returns the UUID;
The javascript onComplete handler then calls the ajax behavior with the
UUID parameter, which allows other components in the page to respond to the
upload.
To prevent overflow in the uploader cache we use a map with a maximum size
which evicts old entries on overflow.
Met vriendelijke groet,
Kind regards,
Bas Gooren
Not sure if I understand.
Post by heapifyman
As far as I got it, the upload plugin requires some "web service" that
accepts POST and DELETE requests to add/remove uploaded files.
Doing that is no problem, I guess.
But how to I link this with the current user's wicket session so that I
know which files the users uploaded when finally the form is submitted?
I'm not sure if I'm using the right wording here. Hope you get the idea...
Hi,
Post by Martin Grigorov
Is it an option to upload to a IResource and store the uploaded data
the same way as if you'd do in the page ?
Post by heapifyman
Hello,
has anyone tried yet to integrate blueimp's jQuery File Upload
http://blueimp.github.com/**jQuery-File-Upload/<http://blueimp.github.com/jQuery-File-Upload/>with Wicket FileUpload?
Especially in combination with additional input fields <input type=text">
I'm kind of stuck because I'm not really sure where to point the jquery
file upload's url param to and how to store the uploaded files in the
wicket page for saving them when the complete form is submitted.
Any help would be appreciated.
Thanks
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
------------------------------**------------------------------**
---------
Bas Gooren
2012-10-16 17:16:53 UTC
Permalink
Behavior (wicket 1.5): http://pastebin.com/WUHsiRL2
instance.js (to initialize uploadify): http://pastebin.com/jGSwzHMN

Mount it in Application.init() with:

// Allow uploads through uploadify
mount( new UploadifyBehavior.Uploader( "/uploadify" ) );

Use it like this:

component.add( new UploadifyBehavior()
{

@Override
protected void onUpload( UploadInfo info,
AjaxRequestTarget target )
{
// Handle upload any way you like, and replace
stuff in this ajax request
}

} );

Met vriendelijke groet,
Kind regards,

Bas Gooren
Post by heapifyman
Thanks.
Would you mind sharing the mounted resource's code? I'm not completely sure
how to implement that.
Post by Bas Gooren
Hi!
We use a different uploader (uploadify), but the basics are the same.
What we've built for this is a behavior which renders the UI for the
uploader, and handles ajax callbacks.
The uploader uploads to a mounted resource (e.g. at /uploadify), which has
an internal cache (UUID => FileInfo).
After a successful upload, the upload resource returns the UUID;
The javascript onComplete handler then calls the ajax behavior with the
UUID parameter, which allows other components in the page to respond to the
upload.
To prevent overflow in the uploader cache we use a map with a maximum size
which evicts old entries on overflow.
Met vriendelijke groet,
Kind regards,
Bas Gooren
Not sure if I understand.
Post by heapifyman
As far as I got it, the upload plugin requires some "web service" that
accepts POST and DELETE requests to add/remove uploaded files.
Doing that is no problem, I guess.
But how to I link this with the current user's wicket session so that I
know which files the users uploaded when finally the form is submitted?
I'm not sure if I'm using the right wording here. Hope you get the idea...
Hi,
Post by Martin Grigorov
Is it an option to upload to a IResource and store the uploaded data
the same way as if you'd do in the page ?
Post by heapifyman
Hello,
has anyone tried yet to integrate blueimp's jQuery File Upload
http://blueimp.github.com/**jQuery-File-Upload/<http://blueimp.github.com/jQuery-File-Upload/>with Wicket FileUpload?
Especially in combination with additional input fields <input type=text">
I'm kind of stuck because I'm not really sure where to point the jquery
file upload's url param to and how to store the uploaded files in the
wicket page for saving them when the complete form is submitted.
Any help would be appreciated.
Thanks
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
------------------------------**------------------------------**
---------
heapifyman
2012-10-24 10:54:03 UTC
Permalink
Thanks. That helped a lot.
Post by Bas Gooren
Behavior (wicket 1.5): http://pastebin.com/WUHsiRL2
instance.js (to initialize uploadify): http://pastebin.com/jGSwzHMN
// Allow uploads through uploadify
mount( new UploadifyBehavior.Uploader( "/uploadify" ) );
component.add( new UploadifyBehavior()
{
@Override
protected void onUpload( UploadInfo info,
AjaxRequestTarget target )
{
// Handle upload any way you like, and replace stuff
in this ajax request
}
} );
Met vriendelijke groet,
Kind regards,
Bas Gooren
Post by heapifyman
Thanks.
Would you mind sharing the mounted resource's code? I'm not completely sure
how to implement that.
Hi!
Post by Bas Gooren
We use a different uploader (uploadify), but the basics are the same.
What we've built for this is a behavior which renders the UI for the
uploader, and handles ajax callbacks.
The uploader uploads to a mounted resource (e.g. at /uploadify), which has
an internal cache (UUID => FileInfo).
After a successful upload, the upload resource returns the UUID;
The javascript onComplete handler then calls the ajax behavior with the
UUID parameter, which allows other components in the page to respond to the
upload.
To prevent overflow in the uploader cache we use a map with a maximum size
which evicts old entries on overflow.
Met vriendelijke groet,
Kind regards,
Bas Gooren
Not sure if I understand.
Post by heapifyman
As far as I got it, the upload plugin requires some "web service" that
accepts POST and DELETE requests to add/remove uploaded files.
Doing that is no problem, I guess.
But how to I link this with the current user's wicket session so that I
know which files the users uploaded when finally the form is submitted?
I'm not sure if I'm using the right wording here. Hope you get the idea...
Hi,
Post by Martin Grigorov
Is it an option to upload to a IResource and store the uploaded data
the same way as if you'd do in the page ?
Hello,
Post by heapifyman
has anyone tried yet to integrate blueimp's jQuery File Upload
http://blueimp.github.com/****jQuery-File-Upload/<http://blueimp.github.com/**jQuery-File-Upload/>
<http://**blueimp.github.com/jQuery-**File-Upload/<http://blueimp.github.com/jQuery-File-Upload/>>with
Wicket FileUpload?
Especially in combination with additional input fields <input type=text">
I'm kind of stuck because I'm not really sure where to point the jquery
file upload's url param to and how to store the uploaded files in the
wicket page for saving them when the complete form is submitted.
Any help would be appreciated.
Thanks
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
------------------------------****----------------------------**--**
---------
Martin Grigorov
2012-11-14 09:51:38 UTC
Permalink
Hi,

I've just added a new article at
http://wicketinaction.com/2012/11/uploading-files-to-wicket-iresource/ that
shows how to integrate such JavaScript file upload widgets with Wicket.
I hope it is useful for you!
Post by heapifyman
Thanks. That helped a lot.
Post by Bas Gooren
Behavior (wicket 1.5): http://pastebin.com/WUHsiRL2
instance.js (to initialize uploadify): http://pastebin.com/jGSwzHMN
// Allow uploads through uploadify
mount( new UploadifyBehavior.Uploader( "/uploadify" ) );
component.add( new UploadifyBehavior()
{
@Override
protected void onUpload( UploadInfo info,
AjaxRequestTarget target )
{
// Handle upload any way you like, and replace stuff
in this ajax request
}
} );
Met vriendelijke groet,
Kind regards,
Bas Gooren
Post by heapifyman
Thanks.
Would you mind sharing the mounted resource's code? I'm not completely sure
how to implement that.
Hi!
Post by Bas Gooren
We use a different uploader (uploadify), but the basics are the same.
What we've built for this is a behavior which renders the UI for the
uploader, and handles ajax callbacks.
The uploader uploads to a mounted resource (e.g. at /uploadify), which has
an internal cache (UUID => FileInfo).
After a successful upload, the upload resource returns the UUID;
The javascript onComplete handler then calls the ajax behavior with the
UUID parameter, which allows other components in the page to respond to the
upload.
To prevent overflow in the uploader cache we use a map with a maximum size
which evicts old entries on overflow.
Met vriendelijke groet,
Kind regards,
Bas Gooren
Not sure if I understand.
Post by heapifyman
As far as I got it, the upload plugin requires some "web service" that
accepts POST and DELETE requests to add/remove uploaded files.
Doing that is no problem, I guess.
But how to I link this with the current user's wicket session so that
I
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
know which files the users uploaded when finally the form is
submitted?
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
I'm not sure if I'm using the right wording here. Hope you get the idea...
Hi,
Post by Martin Grigorov
Is it an option to upload to a IResource and store the uploaded data
the same way as if you'd do in the page ?
Hello,
Post by heapifyman
has anyone tried yet to integrate blueimp's jQuery File Upload
http://blueimp.github.com/****jQuery-File-Upload/<
http://blueimp.github.com/**jQuery-File-Upload/>
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
Post by heapifyman
<http://**blueimp.github.com/jQuery-**File-Upload/<
http://blueimp.github.com/jQuery-File-Upload/>>with
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
Post by heapifyman
Wicket FileUpload?
Especially in combination with additional input fields <input type=text">
I'm kind of stuck because I'm not really sure where to point the jquery
file upload's url param to and how to store the uploaded files in
the
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
Post by heapifyman
wicket page for saving them when the complete form is submitted.
Any help would be appreciated.
Thanks
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
------------------------------****----------------------------**--**
---------
http://apache.org>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>
Pierre Goupil
2012-11-14 10:00:04 UTC
Permalink
Good morning,

Would guys be kind and share these codes, please? Not re-inventing the
whell, you know.

Thanks in advance & best regards,

Pierre
Post by Martin Grigorov
Hi,
I've just added a new article at
http://wicketinaction.com/2012/11/uploading-files-to-wicket-iresource/that
shows how to integrate such JavaScript file upload widgets with Wicket.
I hope it is useful for you!
Post by heapifyman
Thanks. That helped a lot.
Post by Bas Gooren
Behavior (wicket 1.5): http://pastebin.com/WUHsiRL2
instance.js (to initialize uploadify): http://pastebin.com/jGSwzHMN
// Allow uploads through uploadify
mount( new UploadifyBehavior.Uploader( "/uploadify" ) );
component.add( new UploadifyBehavior()
{
@Override
protected void onUpload( UploadInfo info,
AjaxRequestTarget target )
{
// Handle upload any way you like, and replace
stuff
Post by heapifyman
Post by Bas Gooren
in this ajax request
}
} );
Met vriendelijke groet,
Kind regards,
Bas Gooren
Post by heapifyman
Thanks.
Would you mind sharing the mounted resource's code? I'm not completely sure
how to implement that.
Hi!
Post by Bas Gooren
We use a different uploader (uploadify), but the basics are the same.
What we've built for this is a behavior which renders the UI for the
uploader, and handles ajax callbacks.
The uploader uploads to a mounted resource (e.g. at /uploadify),
which
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
has
an internal cache (UUID => FileInfo).
After a successful upload, the upload resource returns the UUID;
The javascript onComplete handler then calls the ajax behavior with
the
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
UUID parameter, which allows other components in the page to respond
to
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
the
upload.
To prevent overflow in the uploader cache we use a map with a maximum size
which evicts old entries on overflow.
Met vriendelijke groet,
Kind regards,
Bas Gooren
Not sure if I understand.
Post by heapifyman
As far as I got it, the upload plugin requires some "web service"
that
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
accepts POST and DELETE requests to add/remove uploaded files.
Doing that is no problem, I guess.
But how to I link this with the current user's wicket session so
that
Post by heapifyman
I
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
know which files the users uploaded when finally the form is
submitted?
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
I'm not sure if I'm using the right wording here. Hope you get the idea...
Hi,
Post by Martin Grigorov
Is it an option to upload to a IResource and store the uploaded
data
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
the same way as if you'd do in the page ?
Hello,
Post by heapifyman
has anyone tried yet to integrate blueimp's jQuery File Upload
http://blueimp.github.com/****jQuery-File-Upload/<
http://blueimp.github.com/**jQuery-File-Upload/>
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
Post by heapifyman
<http://**blueimp.github.com/jQuery-**File-Upload/<
http://blueimp.github.com/jQuery-File-Upload/>>with
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
Post by heapifyman
Wicket FileUpload?
Especially in combination with additional input fields <input type=text">
I'm kind of stuck because I'm not really sure where to point the jquery
file upload's url param to and how to store the uploaded files in
the
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
Post by heapifyman
wicket page for saving them when the complete form is submitted.
Any help would be appreciated.
Thanks
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
------------------------------****----------------------------**--**
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
---------
http://apache.org>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>
--
Le bonheur n'est pas une destination, mais une façon de voyager.

Papa d'une petite Lou-Ann depuis le 30 juin.
Martin Grigorov
2012-11-14 10:03:31 UTC
Permalink
There is a link to my GitHub repo in the article.
Post by Pierre Goupil
Good morning,
Would guys be kind and share these codes, please? Not re-inventing the
whell, you know.
Thanks in advance & best regards,
Pierre
Post by Martin Grigorov
Hi,
I've just added a new article at
http://wicketinaction.com/2012/11/uploading-files-to-wicket-iresource/that
Post by Martin Grigorov
shows how to integrate such JavaScript file upload widgets with Wicket.
I hope it is useful for you!
Post by heapifyman
Thanks. That helped a lot.
Post by Bas Gooren
Behavior (wicket 1.5): http://pastebin.com/WUHsiRL2
instance.js (to initialize uploadify): http://pastebin.com/jGSwzHMN
// Allow uploads through uploadify
mount( new UploadifyBehavior.Uploader( "/uploadify" ) );
component.add( new UploadifyBehavior()
{
@Override
protected void onUpload( UploadInfo info,
AjaxRequestTarget target )
{
// Handle upload any way you like, and replace
stuff
Post by heapifyman
Post by Bas Gooren
in this ajax request
}
} );
Met vriendelijke groet,
Kind regards,
Bas Gooren
Post by heapifyman
Thanks.
Would you mind sharing the mounted resource's code? I'm not
completely
Post by Martin Grigorov
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
sure
how to implement that.
Hi!
Post by Bas Gooren
We use a different uploader (uploadify), but the basics are the
same.
Post by Martin Grigorov
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
What we've built for this is a behavior which renders the UI for
the
Post by Martin Grigorov
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
uploader, and handles ajax callbacks.
The uploader uploads to a mounted resource (e.g. at /uploadify),
which
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
has
an internal cache (UUID => FileInfo).
After a successful upload, the upload resource returns the UUID;
The javascript onComplete handler then calls the ajax behavior with
the
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
UUID parameter, which allows other components in the page to
respond
Post by Martin Grigorov
to
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
the
upload.
To prevent overflow in the uploader cache we use a map with a
maximum
Post by Martin Grigorov
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
size
which evicts old entries on overflow.
Met vriendelijke groet,
Kind regards,
Bas Gooren
Not sure if I understand.
Post by heapifyman
As far as I got it, the upload plugin requires some "web service"
that
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
accepts POST and DELETE requests to add/remove uploaded files.
Doing that is no problem, I guess.
But how to I link this with the current user's wicket session so
that
Post by heapifyman
I
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
know which files the users uploaded when finally the form is
submitted?
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
I'm not sure if I'm using the right wording here. Hope you get the
idea...
Hi,
Post by Martin Grigorov
Is it an option to upload to a IResource and store the uploaded
data
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
the same way as if you'd do in the page ?
On Tue, Oct 16, 2012 at 12:49 PM, heapifyman <
Hello,
Post by heapifyman
has anyone tried yet to integrate blueimp's jQuery File Upload
http://blueimp.github.com/****jQuery-File-Upload/<
http://blueimp.github.com/**jQuery-File-Upload/>
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
Post by heapifyman
<http://**blueimp.github.com/jQuery-**File-Upload/<
http://blueimp.github.com/jQuery-File-Upload/>>with
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
Post by heapifyman
Wicket FileUpload?
Especially in combination with additional input fields <input
type=text">
I'm kind of stuck because I'm not really sure where to point the
jquery
file upload's url param to and how to store the uploaded files
in
Post by Martin Grigorov
Post by heapifyman
the
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
Post by heapifyman
wicket page for saving them when the complete form is submitted.
Any help would be appreciated.
Thanks
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
------------------------------****----------------------------**--**
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
---------
http://apache.org>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>
--
Le bonheur n'est pas une destination, mais une façon de voyager.
Papa d'une petite Lou-Ann depuis le 30 juin.
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>
Pierre Goupil
2012-11-14 10:08:05 UTC
Permalink
Thanks! Sorry for not having read it until the end! :-)
Post by Martin Grigorov
There is a link to my GitHub repo in the article.
Post by Pierre Goupil
Good morning,
Would guys be kind and share these codes, please? Not re-inventing the
whell, you know.
Thanks in advance & best regards,
Pierre
Post by Martin Grigorov
Hi,
I've just added a new article at
http://wicketinaction.com/2012/11/uploading-files-to-wicket-iresource/that
Post by Pierre Goupil
Post by Martin Grigorov
shows how to integrate such JavaScript file upload widgets with Wicket.
I hope it is useful for you!
Post by heapifyman
Thanks. That helped a lot.
Post by Bas Gooren
Behavior (wicket 1.5): http://pastebin.com/WUHsiRL2
http://pastebin.com/jGSwzHMN
Post by Pierre Goupil
Post by Martin Grigorov
Post by heapifyman
Post by Bas Gooren
// Allow uploads through uploadify
mount( new UploadifyBehavior.Uploader( "/uploadify" ) );
component.add( new UploadifyBehavior()
{
@Override
protected void onUpload( UploadInfo info,
AjaxRequestTarget target )
{
// Handle upload any way you like, and replace
stuff
Post by heapifyman
Post by Bas Gooren
in this ajax request
}
} );
Met vriendelijke groet,
Kind regards,
Bas Gooren
Post by heapifyman
Thanks.
Would you mind sharing the mounted resource's code? I'm not
completely
Post by Martin Grigorov
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
sure
how to implement that.
Hi!
Post by Bas Gooren
We use a different uploader (uploadify), but the basics are the
same.
Post by Martin Grigorov
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
What we've built for this is a behavior which renders the UI for
the
Post by Martin Grigorov
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
uploader, and handles ajax callbacks.
The uploader uploads to a mounted resource (e.g. at /uploadify),
which
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
has
an internal cache (UUID => FileInfo).
After a successful upload, the upload resource returns the UUID;
The javascript onComplete handler then calls the ajax behavior
with
Post by Pierre Goupil
Post by Martin Grigorov
the
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
UUID parameter, which allows other components in the page to
respond
Post by Martin Grigorov
to
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
the
upload.
To prevent overflow in the uploader cache we use a map with a
maximum
Post by Martin Grigorov
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
size
which evicts old entries on overflow.
Met vriendelijke groet,
Kind regards,
Bas Gooren
Not sure if I understand.
Post by heapifyman
As far as I got it, the upload plugin requires some "web
service"
Post by Pierre Goupil
Post by Martin Grigorov
that
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
accepts POST and DELETE requests to add/remove uploaded files.
Doing that is no problem, I guess.
But how to I link this with the current user's wicket session so
that
Post by heapifyman
I
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
know which files the users uploaded when finally the form is
submitted?
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
I'm not sure if I'm using the right wording here. Hope you get
the
Post by Pierre Goupil
Post by Martin Grigorov
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
idea...
Hi,
Post by Martin Grigorov
Is it an option to upload to a IResource and store the uploaded
data
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
the same way as if you'd do in the page ?
On Tue, Oct 16, 2012 at 12:49 PM, heapifyman <
Hello,
Post by heapifyman
has anyone tried yet to integrate blueimp's jQuery File Upload
http://blueimp.github.com/****jQuery-File-Upload/<
http://blueimp.github.com/**jQuery-File-Upload/>
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
Post by heapifyman
<http://**blueimp.github.com/jQuery-**File-Upload/<
http://blueimp.github.com/jQuery-File-Upload/>>with
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
Post by heapifyman
Wicket FileUpload?
Especially in combination with additional input fields <input
type=text">
I'm kind of stuck because I'm not really sure where to point
the
Post by Pierre Goupil
Post by Martin Grigorov
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
Post by heapifyman
jquery
file upload's url param to and how to store the uploaded files
in
Post by Martin Grigorov
Post by heapifyman
the
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
Post by heapifyman
wicket page for saving them when the complete form is
submitted.
Post by Pierre Goupil
Post by Martin Grigorov
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
Post by heapifyman
Any help would be appreciated.
Thanks
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
------------------------------****----------------------------**--**
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Bas Gooren
Post by heapifyman
Post by Martin Grigorov
---------
che.org<
Post by Pierre Goupil
Post by Martin Grigorov
Post by heapifyman
http://apache.org>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>
--
Le bonheur n'est pas une destination, mais une façon de voyager.
Papa d'une petite Lou-Ann depuis le 30 juin.
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>
--
Le bonheur n'est pas une destination, mais une façon de voyager.

Papa d'une petite Lou-Ann depuis le 30 juin.
Raul
2012-11-15 14:57:33 UTC
Permalink
Thanks for the demo, everything works fine except for some problems I've
found in the configuration, for example, the demo comes with the option
(previewSourceFileTypes: / ^ image \ / (gif | jpeg | png) $ /,). But really
allow to upload all types of files.

On the other hand (and this is important to me), when I upload multiple
files at once, only shows the bar and the buttons for the first file. And
should display them at all.





--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-and-file-upload-with-blueimp-jquery-file-upload-tp4653007p4653903.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Martin Grigorov
2012-11-15 15:03:04 UTC
Permalink
Post by Raul
Thanks for the demo, everything works fine except for some problems I've
found in the configuration, for example, the demo comes with the option
(previewSourceFileTypes: / ^ image \ / (gif | jpeg | png) $ /,). But really
allow to upload all types of files.
This setting is supported only by modern browsers (HTML5).
Post by Raul
On the other hand (and this is important to me), when I upload multiple
files at once, only shows the bar and the buttons for the first file. And
should display them at all.
As I said at the end of the article - I am disappointed from the widget.
Its docs do not explain all the hidden requirements for the UI part of it.
If you fix these issues then I'll be happy to apply your improvements.
Post by Raul
--
http://apache-wicket.1842946.n4.nabble.com/Wicket-and-file-upload-with-blueimp-jquery-file-upload-tp4653007p4653903.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>
Raul
2012-11-16 14:08:24 UTC
Permalink
I solved the problems I had, modifying the main.js file of the demo, as
follows.

$(function () {
'use strict';

$('#${componentMarkupId}').fileupload({
url: '${url}',
paramName: '${paramName}',
singleFileUploads: true,
maxFileSize: 5000000,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
process: [
{
action: 'load',
fileTypes: /^image\/(gif|jpeg|png)$/,
maxFileSize: 20000000 // 20MB
},
{
action: 'resize',
maxWidth: 1440,
maxHeight: 900
},
{
action: 'save'
}
]
});
});




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-and-file-upload-with-blueimp-jquery-file-upload-tp4653007p4653938.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org

Loading...