Hi Juan
-- I'm not sure if i understand you right. but i don't receive the event. It's clear in the sample i wrote only a message to the console, so i see if i receive the event. but the problem is: i'm not called. When you write "..you never register the handlers...", can you tell me where and how i can do this? i'm really sorry for my questions, but i searched the internet and i did not find an answer.
And i'm sure, it must be a missing piece there.. (When it is possible to make a label-object drop-sensitive, then it must be possible to make this with an image object too..
Lorenzo
Am Freitag, 11. April 2014 15:38:18 UTC+2 schrieb Juan Pablo Gardella:
Am Freitag, 11. April 2014 15:38:18 UTC+2 schrieb Juan Pablo Gardella:
Hi,It seems that you never register the handlers. All the implementations are empty.Juan2014-04-11 10:30 GMT-03:00 lmedici <med...@pm-medici.ch>:
Hi--try to implement an upload of an image via drag and drop. i created a dialog with a preview image and a dropping zone. this is a label. with type of widget it works fine. i can drop the image form the desktop to my dialog and i receive the dropevent. i attached the required handlers to the label and this works perfect.To make it better i shoudl attach the required dnd-handlers to the iimage object, so i can drop a new image over the old image. But here i have big problems. when i attach the handlers i don't receive the events. i tried to create a image-wrapperclass, but i don't get a desired result.. i can not see the difference between the label-widget and the image-widget.I'm very gratefull for every help...Thanks for every hintHere what i made:this was the warapperimage...package ch.pmm.coolartsclient.client.widgets.uploadmanager; import com.google.gwt.event.dom.client.DragEndHandler; import com.google.gwt.event.dom.client.DragEnterHandler; import com.google.gwt.event.dom.client.DragHandler; import com.google.gwt.event.dom.client.DragLeaveHandler; import com.google.gwt.event.dom.client.DragOverHandler; import com.google.gwt.event.dom.client.DragStartHandler; import com.google.gwt.event.dom.client.DropHandler; import com.google.gwt.event.dom.client. HasAllDragAndDropHandlers; import com.google.gwt.event.shared.HandlerRegistration; import com.smartgwt.client.widgets.Img; import com.smartgwt.client.widgets.events.DropCompleteHandler; public class DroppableImage extends Img implements HasAllDragAndDropHandlers,com.smartgwt.client.widgets.events. HasDropCompleteHandlers, com.smartgwt.client.widgets.events.HasDropHandlers, com.smartgwt.client.widgets.events.HasDropOverHandlers {public DroppableImage(){super();}public DroppableImage(String sSrc){super(sSrc);}@Overridepublic HandlerRegistration addDragEndHandler(DragEndHandler handler) {System.out.println("Image: addDragEndHandler");return null;}@Overridepublic HandlerRegistration addDragEnterHandler(DragEnterHandler handler) {System.out.println("Image: addDragEnterHandler");return null;}@Overridepublic HandlerRegistration addDragLeaveHandler(DragLeaveHandler handler) {System.out.println("Image: addDragLeaveHandler");return null;}@Overridepublic HandlerRegistration addDragHandler(DragHandler handler){System.out.println("Image: addDragHandler");return null;}@Overridepublic HandlerRegistration addDragOverHandler(DragOverHandler handler) {System.out.println("Image: addDragOverHandler");return null;}@Overridepublic HandlerRegistration addDragStartHandler(DragStartHandler handler) {System.out.println("Image: addDragStartHandler");return null;}@Overridepublic HandlerRegistration addDropHandler(DropHandler handler){System.out.println("Image: addDropHandler");return null;}@Overridepublic HandlerRegistration addDropCompleteHandler(DropCompleteHandler handler) {System.out.println("Image: addDropCompleteHandler");return null;}}//---------------------------------------------------------- ------------------------------ ------------------------------ ------------------------------ -- and when i create the image in the DialogClass then i go to over this method...private void create_oImage(String sSrc) {if(sSrc.equals("")) m_oImage = new DroppableImage();else m_oImage = new DroppableImage(sSrc);m_oImage.addDropOverHandler(new DropOverHandler() { @Overridepublic void onDropOver(DropOverEvent event){System.out.println("Image: Hello DropOverHandler is calling!!!");}});m_oImage.addDropHandler(new DropHandler() {@Overridepublic void onDrop(DropEvent event){System.out.println("Image: Hello DropHandler is calling!!!");}});m_oImage.addDropOutHandler(new DropOutHandler() {@Overridepublic void onDropOut(DropOutEvent event){System.out.println("image: dropOutHandler");}});}
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com .
To post to this group, send email to google-we...@googlegroups.com .
Visit this group at http://groups.google.com/group/google-web-toolkit .
For more options, visit https://groups.google.com/d/optout .
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment