This test fails as the event handler is called twice...

public void testFoo() {
    Element body = RootPanel.getBodyElement();

    Element div = DOM.createDiv();
    div.setId(DOM.createUniqueId());

    body.appendChild(div);

    ListBox lb = new ListBox();
    RootPanel.get(div.getId()).add(lb);

    lb.addItem("a");
    lb.addItem("b");

    final List<String> l = new ArrayList<String>();

    lb.addChangeHandler(new ChangeHandler() {
      @Override
      public void onChange(ChangeEvent event) {
        l.add("aa");
      }
    });

    lb.setSelectedIndex(1);
    assertEquals(0, l.size());
  }

Am I doing something stupid? I get the same result in dev and prod
modes. The stack trace is horribly complicated so I'm not that keen to
dive in and try and debug this...

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

Reply via email to