Results 1 to 4 of 4

Thread: mouse event detection problem in firefox since Gxt 2.0.2

  1. #1
    Ext User
    Join Date
    Feb 2009
    Posts
    19
    Vote Rating
    0
      0  

    Default mouse event detection problem in firefox since Gxt 2.0.2

    Hi,

    I experienced a bug with mouse event detection since i moved from Gxt 2.0.1 to Gxt 2.0.2
    The bug occurs in Firefox (i use 3.5) while it doesn't in hosted mode and Internet Explorer

    I used the following code to reproduce the problem :


    public class Test implements EntryPoint {

    public void onModuleLoad() {
    Viewport viewport = new Viewport();
    viewport.setLayout(new RowLayout());

    LabelField lbl1 = new LabelField();
    lbl1.setText("Move mouse over me");
    lbl1.sinkEvents(Events.OnMouseDown.getEventCode());
    lbl1.sinkEvents(Events.OnMouseOver.getEventCode());
    lbl1.addListener(Events.OnMouseOver, new Listener<ComponentEvent>() {
    public void handleEvent(ComponentEvent ce) {
    Info.display("", "Lbl 1 Mouse over !!! ");
    }
    });
    lbl1.addListener(Events.OnMouseDown, new Listener<ComponentEvent>() {
    public void handleEvent(ComponentEvent ce) {
    Info.display("", "Lbl 1 Mouse down !!! ");
    }
    });

    LabelField lbl2 = new LabelField();
    lbl2.setText("Move mouse over me");
    lbl2.sinkEvents(Events.OnMouseDown.getEventCode());
    lbl2.sinkEvents(Events.OnMouseOver.getEventCode());
    lbl2.addListener(Events.OnMouseOver, new Listener<ComponentEvent>() {
    public void handleEvent(ComponentEvent ce) {
    Info.display("", "lbl2 Mouse over !!! ");
    }
    });

    lbl2.addListener(Events.OnMouseDown, new Listener<ComponentEvent>() {
    public void handleEvent(ComponentEvent ce) {
    Info.display("", "Lbl 2 Mouse down !!! ");
    }
    });

    ContentPanel cp1 = new ContentPanel();
    cp1.setHeaderVisible(false);
    ContentPanel cp2 = new ContentPanel();
    cp2.setHeaderVisible(false);

    cp1.add(lbl1);
    cp2.add(lbl2);

    viewport.add(cp1);
    viewport.add(cp2);

    RootPanel.get().add(viewport);
    }

    }


    When i move the mouse over the 2 LabelField, the event is well detected.
    However if i click on one LabelField and then move the cursor to the other without releasing the mouse click, the MouseOver event is not detected on the second LabelField in Firefox whereas it is under IE

    Thanks

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    131
      0  

    Default

    This is nto a bug. This is how browser events, that you are using work. You need to get in touch with preview events and captaring events.

  3. #3
    Ext User
    Join Date
    Feb 2009
    Posts
    19
    Vote Rating
    0
      0  

    Default

    Hi sven

    i thought it was a regression because the firefox behaviour was the same than ie's with Gxt 2.0.1.

    And sorry , i don't see what you mean with the "preview events" . Can you be more specific please ?

    Thanks

  4. #4
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    131
      0  

    Default

    Take a look at the baseeventpreview class. Draggable in GXT uses it for example.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •