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.

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
})

The annotated output follows:

app tabview changesel PAGE qx.ui.tabview.Page[1t] 
http://localhost:9090/nuviaqxd
app tabview pg childs qx.ui.form.RadioButton[1w],nuvia.Itemset.Browser[25]

[Apparently the tab button itself at this point is a child.]

http://localhost:9090/nuviaqxd
app tabview changesel PAGE childqx.ui.form.RadioButton[1w] 
http://localhost:9090/nuviaqxd
app tabview changesel frontns now: undefined

[The field I want is from the first widget I added to a page, but child 
zero is coming back as the radio button/tab, IIUC.]

http://localhost:9090/nuviaqxd
root teoqx.ui.root.Application[o] http://localhost:9090/nuviaqxd
Logges in kenzo http://localhost:9090/nuviaqxd
adding qx.ui.tabview.Page[1se] http://localhost:9090/nuviaqxd
got projs pmax,powermax 21,asphips,ASP titanium hips on true 
http://localhost:9090/nuviaqxd
dispatching: undefinedItemStylePanels http://localhost:9090/nuviaqxd
dispatching: undefinedItemStylePanels http://localhost:9090/nuviaqxd
app tabview changesel PAGE qx.ui.tabview.Page[wk] 
http://localhost:9090/nuviaqxd
app tabview pg childs nuvia.Itemset.Browser[wv]

[Now I am actually changing tabs, and from here on the radio button will 
not come back as a child of the page, including the first page which 
originally had a radiobutton in the children as well.]

My guess is that the restructuring qx does behind the scenes is being 
done /after/ the changeselected message goes out. If so, it seems to me 
the reverse order makes more sense: finish initializing X before telling 
the world about X.

hth, kenny


------------------------------------------------------------------------------
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