On Mon, Jan 2, 2012 at 18:34, Scott Chapman <[email protected]> wrote:
> I need to be able to tell if a tab is already opened and give it the focus
> if it is, rather than opening a duplicate.
>
> What's the right way to search all the tab's labels and give a tab the
> focus?
>
In my example, I've assigned user data to each page, and I'm looking for
the one with a particular uid. You may have some other way of determining
which page is which...
page = null;
mainTabs.getChildren().forEach(
function(thisPage)
{
var lookingAt = thisPage.getUserData("app_uid");
if (lookingAt == uid)
{
// We found the page we were looking for. Note it.
page = thisPage;
// Select the existing application page
mainTabs.setSelection([ page ]);
}
});
// If we didn't find an existing tab, create a new one.
if (! page)
{
// create a new page here
}
Derrell
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel