Hi,

I am using the "changeSelected" event on qx.ui.tabview.TabView.
Now, when I write e.stopPropagation(); in my event listener function, 
Firebug gives an error stating :
Assertion error! Cannot stop propagation on a non bubbling event: 
changeSelected: Called assertTrue with 'false'

I made my event as a bubbling event as e.setBubbles(true); and then 
called e.stopPropagation();. Now, I don't get any error but my event 
lister gets called twice.

My tabview initially has 2 tabs - Actual and dummy. The eventlistener is 
set on Tabview and the Actual tab is selected by default. When the dummy 
tab is clicked, my eventlistener checks which tab is clicked (based on 
page label). If dummy is clicked, it deletes the dummy tab, adds a new 
tab and then inserts dummy to its end (functionality similar to that in 
IE7).

If I write e.stopPropagation(), I get the desired functionality but with 
errors in Firebug. If I don't write e.stopPropagation() or I write 
e.setBubbles(true); e.stopPropagation();, then on clicking dummy tab, 2 
tabs get added instead of 1 (ie. eventListener gets called twice), which 
I don't want.

Here is a snippet of my code :

this._tabView.addListener("changeSelected",this._choosePage,this);    
//in class constructor

_choosePage: function(e){   //member function
    var tabView = e.getTarget();
    var pg = tabView.getSelected();
           
    alert(pg.getLabel());
           
    if(pg.getLabel()== ""){   //if dummy tab is clicked
    this._dummytab();    //deleting dummy tab and add a new tab
    e.setBubbles(true);   //Writing this line prevents the Firebug error 
but calls the eventListener twice and causes 2 tabs to get added instead 
of 1
    e.stopPropagation(); // Writing just this without above line adds 
just 1 tab (desired) but causes Firebug error
    
this._tabView.addListener("changeSelected",this._choosePage,this);    
//since listener was removed
               
   }
}

_dummytab: function(){
    
this._tabView.removeListener("changeSelected",this._choosePage,this);   
//else tabView.remove() calls the eventListener _choosePage() again
    this._tabView.remove(targetPage);
    this._addtab();   //adds a new tab and then dummy tab
}


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to