I'm making a wicket app that can manage some options for a cashdesk app. One of the options is to change the image of a selected
Product.
The user(manager) can choose from the already present images in the database (SQL) when this option is selected, or add a new image if the desired image is not present. Don't mention the test names and awesome images (it's still in test-fase)
I prefer to see the adding of an image achieved by Drag and Drop
html5 demo [dnd-upload]
(From the desktop into the browser)
I'm currently using Wicket-6.2.0 and wicket-dnd 0.5.0 and i can't seem to get this working! All examples I can find are from wicket 2.x or lower.
It is possible to use drag and drop in Wicket-6.2, but how do I achieve this?
There seems to be some DraggableBehavior in wicket? Any help is welcome!
[UPDATE]
Upgraded to wicket-dnd 0.6
Based on your code I wrote my custom Ajax behavior. I simplified it however, it is working for me without dragging hack.
AbstractFileDropAjaxBehavior.java
So here is the answer as promised! (only code but easy to understand if you are familiar with wicket)
The code makes it possible to drag a file to an area, and sends it to the wicket server (no matter what file it gets) this is not always what you want (but only what I need).
add the following javascript check in the drop.js if you only want 1 type of file to be uploaded:
files:
- MyPage.java
- MyPage.html
- DropZone.java
- DropZone.html
- DropZone.properties
- DropAjaxBehavior
- drop.js
- drop.css
Used Libs:
- jQuery.js
- jQuery-ui.js
- wicket 6.2
- slf4j-1.2.16
- log4j-1.2.16
- guava-13.0.1
I did not included the imports because, i'm lazy
MyPage.java
MyPage.html
DropZone.java
DropZone.html
DropZone.properties
DropAjaxBehavior.java
drop.css
drop.js