Alexander Back wrote:
> Hi Kenny,
> 
> Kenneth Tilton wrote:
>> I listen to "changeSelected" on a Tabview to keep track of who is in 
>> front. Works well except on app start-up, where it appears the initial 
>> "changeSelected" gets kicked off before the selected page's structure 
>> has been finalized.
> I've just tested a tabView widget with several pages at the playground 
> and I get only one call of the event listener at startup and the rest is 
> working as expected.

Yes, I only get one call on startup, but at that call the page returned 
by getSelected has two children (so I suspect the page returned by 
getData will be the same page and so I'll still see two children).

I'm OK, I just threw in a hack to always take the last child. :) But if 
"changeSelected" is being called before the widget is ready, folks may 
run into other problems eventually.

thx, kenny

> 
>> The logging/working listener code is this:
>>
>> tabView.addListener("changeSelected", function (e) {
>>     pg = tabView.getSelected();
>>     console.log("app tabview changesel PAGE " + pg );
>>     console.log("app tabview pg childs " + pg.getChildren());
>>     mod = pg.getChildren()[0];
>>     console.log("app tabview changesel PAGE child" + mod);
>>     console.log("app tabview changesel frontns now: "+ mod.ns);
>>
>>     frontNS=mod.ns; // the real code
>> })
> If you use the "changeSelected" event you can use
> 
> --snip--
> tabView.addListener("changeSelected", function(e){
>    var selectedTabViewPage = e.getData();
> });
> --snip--
> 
> the "getData()" method to access the currently selected tabView page 
> instance.
> 
> cheers,
>    Alex
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 
> 

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to