Thursday, April 3, 2014

catch the Click Event on the TextBox draggable

I'm developing with the dnd library 3.3.0 and my goal is to catch the click event on the text box draggable.

I create the textBox draggable :
8<----------------------------------------------------------------->8
    private Widget createDraggableTextBox() {
        ClickTextBox textBox = new ClickTextBox(demoDragHandler);
        dragController.makeDraggable(textBox);
        return textBox;
    }

public class ClickTextBox extends TextBox {

  private DemoDragHandler demoDragHandler;

  public ClickTextBox(DemoDragHandler demoDragHandler) {
    this.demoDragHandler = demoDragHandler;

  }

  @Override
  public void setText(String text) {
    super.setText(text);
  }
}
8<------------------------------------

and now in my script to catch the click event I invoke:

for(final WSIO input:inputList){  // nn cycles
....
    Widget wi = createDraggableTextBox();
    wi.addAttachHandler(new AttachEvent.Handler() {
       @Override
   public void onAttachOrDetach(AttachEvent event) {
    //do something
...   
}
}

But the PROBLEM is that IT will catch n(size of cycles's FOR  ) events with only one click .
I would have need to catch only one event by only one click.
I'm waiting for an help for this idiosyncrasy,
thanks in advance to anybody to help me


Paola Montorio

--
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