1. #1
    Ext GWT Premium Member
    Join Date
    Aug 2009
    Location
    Kensington, MD
    Posts
    29
    Vote Rating
    0
    cpopp is on a distinguished road

      0  

    Default Strange behavior attaching Listener to a WidgetComponent

    Strange behavior attaching Listener to a WidgetComponent


    This is a continuation of previous post about turning an icon into a WidgetComponent.

    Here's the basic code setup:

    Code:
    WidgetComponent w = new WidgetComponent(myIcon);
    w.setToolTip("test");
    w.addListener(Events.OnMouseOver, new Listener<ComponentEvent>() {
       @Override
       public void handleEvent(ComponentEvent e) {
          EventType type = e.getType();
          if (type == Events.OnMouseOver) {
             //do stuff
          }
       }
    });
    This behaves as expected.

    The strange part is if I remove the w.setToolTip("test") line the other Listener stuff doesn't happen. For some reason the setToolTip() method correctly attaches a listener but just adding a Listener directly doesn't work.

    Is this a bug, or am I missing something.
    Software Developer
    Helm Point Solutions, Inc.

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Its a bug yes, but in your code. When listening to browserevents you will need so sink the event you want to listen to.

    setToolTip is doing that because it needs the events.

    Code:
    w.sinkEvents(EVENT.ONMOUSEOVER);

  3. #3
    Ext GWT Premium Member
    Join Date
    Aug 2009
    Location
    Kensington, MD
    Posts
    29
    Vote Rating
    0
    cpopp is on a distinguished road

      0  

    Default


    That was the issue.

    I so enjoy making rookie mistakes.

    Thanks again sven.
    Software Developer
    Helm Point Solutions, Inc.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi