1. #1
    Ext User
    Join Date
    Apr 2008
    Posts
    3
    Vote Rating
    0
    Tapir0815 is on a distinguished road

      0  

    Default Event problem with TextToolItem

    Event problem with TextToolItem


    Hi ,

    A click (Events.Click) on TextToolItem never invoke handleEvent of Listener. "Toggle Click" (Events.Toggle) works fine.

    What's wrong? Any idee?

    Thanks!


    Code:
            Listener listener = new Listener<BaseEvent>() {
    
                public void handleEvent(BaseEvent baseEvent) {
                    Window.alert(((ButtonEvent) baseEvent).button.getText());
                }
    
            };
    
            final TextToolItem itemExport = new TextToolItem("Export");
            itemExport.setToolTip("Show Export Explorer");
            itemExport.setIconStyle("icon-export");
            itemExport.addListener(Events.Click, listener);
    
            final ToggleToolItem itemSynchronise = new ToggleToolItem("Synchroise");
            itemSynchronise.setToolTip("Toggle Synchronise Explorer");
            itemSynchronise.setIconStyle("icon-synchronise");
            itemSynchronise.addListener(Events.Toggle, listener);
    
            final ToolBar toolBar = new ToolBar();
            toolBar.add(itemExport);
            toolBar.add(new SeparatorToolItem());
            toolBar.add(itemSynchronise);

  2. #2
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    TextToolItem does not fire the Click event, it fires the Select event. Each component should define what events is fires in its javadocs. There is one issue that is being corrected for the next in beta2. TextToolItem wraps a Button and it is the Button that is passed to the listeners in the ButtonEvent.

    So you can do this:
    Code:
        TextToolItem standard = new TextToolItem("Click Me");
        standard.addListener(Events.Select, new Listener<ButtonEvent>() {
          public void handleEvent(ButtonEvent be) {
            System.out.println("bang bang");
          }
        });
    You can also use a SelectionListener:
    Code:
        standard.addSelectionListener(new SelectionListener() {
          public void componentSelected(ComponentEvent ce) {
            System.out.println("i have been selected");
          }
        });

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