Permalink
Browse files

[BUG #6455] template for mobile app does not work

Updated playground example.
* PlayArea now has its own Manager.
* Pages are now just added to the Manager. >> Easier to use.
  • Loading branch information...
1 parent 9768711 commit 67dc12478f2982de307ce497fd1bbaddb76908d0 Christopher Zuendorf committed with czuendorf May 29, 2012
@@ -14,6 +14,7 @@
Authors:
* Martin Wittemann (martinwittemann)
+ * Christopher Zuendorf (czuendorf)
************************************************************************ */
/**
@@ -25,6 +26,10 @@ qx.Class.define("playground.view.MobilePlayArea",
members :
{
+ // Page manager
+ __manager : null,
+
+
// overridden
init : function()
{
@@ -41,14 +46,13 @@ qx.Class.define("playground.view.MobilePlayArea",
playRootEl.style["background"] = "none";
}
-
this._playRoot = new qx.ui.mobile.core.Root(playRootEl);
var self = this;
-
+
this._playApp = new qx.application.Mobile();
- this._playApp.getRoot = function() {
- return self._playRoot;
+ this._playApp.getManager = function() {
+ return self.__manager;
};
this._initialized = true;
@@ -58,6 +62,13 @@ qx.Class.define("playground.view.MobilePlayArea",
// overridden
reset : function(beforeReg, afterReg, code) {
this._playRoot.removeAll();
+
+ if(this.__manager) {
+ this.__manager.dispose();
+ this.__manager = null;
+ }
+
+ this.__manager = new qx.ui.mobile.page.Manager(false, this._playRoot);
}
}
});
@@ -28,9 +28,7 @@
<!-- ********************************************************************** -->
-<textarea class="qx_samples" title="Hello World-mobile">var navigationContainer = new qx.ui.mobile.container.Navigation();
-this.getRoot().add(navigationContainer, {flex:1});
-
+<textarea class="qx_samples" title="Hello World-mobile">
var page = new qx.ui.mobile.page.NavigationPage();
page.setTitle("Hello World");
page.addListener("initialize", function() {
@@ -41,16 +39,18 @@
alert("Hello World");
}, this);
},this);
-navigationContainer.add(page);
+
+this.getManager().addDetail([
+ page
+]);
+
page.show();</textarea>
<!-- ********************************************************************** -->
-<textarea class="qx_samples" title="List-mobile">var navigationContainer = new qx.ui.mobile.container.Navigation();
-this.getRoot().add(navigationContainer, {flex:1});
-
+<textarea class="qx_samples" title="List-mobile">
var page = new qx.ui.mobile.page.NavigationPage();
page.setTitle("List");
page.addListener("initialize", function() {
@@ -79,17 +79,17 @@
page.getContent().add(list);
},this);
-navigationContainer.add(page,{flex:1});
+this.getManager().addDetail([
+ page
+]);
+
page.show();</textarea>
<!-- ********************************************************************** -->
-<textarea class="qx_samples" title="Pages-mobile">var navigationContainer = new qx.ui.mobile.container.Navigation();
-this.getRoot().add(navigationContainer, {flex:1});
-
-// Page 1
+<textarea class="qx_samples" title="Pages-mobile">// Page 1
var page1 = new qx.ui.mobile.page.NavigationPage();
page1.setTitle("Page 1");
page1.addListener("initialize", function() {
@@ -117,8 +117,10 @@
page1.show({reverse:true});
}, this);
-navigationContainer.add(page1);
-navigationContainer.add(page2);
+this.getManager().addDetail([
+ page1,
+ page2
+]);
page1.show();</textarea>
@@ -128,9 +130,6 @@
<textarea class="qx_samples" title="Form-mobile">
-var navigationContainer = new qx.ui.mobile.container.Navigation();
-this.getRoot().add(navigationContainer, {flex:1});
-
var page = new qx.ui.mobile.page.NavigationPage();
page.setTitle("Login");
page.addListener("initialize", function() {
@@ -160,7 +159,7 @@
}, this);
},this);
-navigationContainer.add(page);
+this.getManager().addDetail([page]);
page.show();</textarea>
@@ -169,9 +168,6 @@
<textarea class="qx_samples" title="YQL Binding-mobile">
-var navigationContainer = new qx.ui.mobile.container.Navigation();
-this.getRoot().add(navigationContainer, {flex:1});
-
// Data model
var query = "select * from feed where url='http://feeds.feedburner.com/qooxdoo/news/content'";
@@ -197,7 +193,7 @@
page.getContent().add(list);
},this);
-navigationContainer.add(page);
+this.getManager().addDetail([page]);
page.show();</textarea>
@@ -83,7 +83,7 @@ qx.Class.define("${Namespace}.Application",
page1.show({reverse:true});
}, this);
- // Add the pages to the page manager.
+ // Add the pages to the page manager.
var manager = new qx.ui.mobile.page.Manager(false);
manager.addDetail([
page1,

0 comments on commit 67dc124

Please sign in to comment.