There are several strange things going on here:

* in the source version, the hashchange listener is called once on 
application startup even though you register it *after* setting the hash 
to "inicio".

* in the build version, the "appear" event for page2 is fired on 
application startup. I've opened a report for this: 
http://bugzilla.qooxdoo.org/show_bug.cgi?id=7695
Unfortunately, working around this behavior doesn't fix your problem.

* in the build version (Chrome but not Firefox), the hashchange listener 
isn't called when the browser's back button is pressed on the second 
page. That seems to be the cause of the problem but I have no idea how 
to fix it :(

I'll have our mobile framework expert look into this issue, but it'll be 
a while before he's back in the office.

Regards,
Daniel

On 28.08.2013 02:18, rsantiagopaz wrote:
>       this.cancelarback = false;
>       window.location.hash = "inicio";
>       
>       this.hashChange = {widgets: {}, functions: []};
>       this.apilarHashChange = qx.lang.Function.bind(function(widget, fnc) {
>               if (this.hashChange.widgets[widget] == null) {
>                       this.hashChange.widgets[widget] = 
> this.hashChange.functions.length;
>                       this.hashChange.functions.push({widget: widget, fnc: 
> fnc});
>               }
>       }, this);
>       
>       this.desapilarHashChange = qx.lang.Function.bind(function(widget) {
>               var index = this.hashChange.widgets[widget];
>               if (index != null) {
>                       var item = this.hashChange.functions.pop();
>                       this.hashChange.widgets[item.widget] = null;
>                       item.fnc();
>               }
>       }, this);
>       
>       window.addEventListener("hashchange", qx.lang.Function.bind(function(e){
>               if (this.cancelarback) {
>                       this.cancelarback = false;
>                       window.location.hash = "1";
>                       if (this.hashChange.functions.length > 0) {
>                               var item = this.hashChange.functions.pop();
>                               this.hashChange.widgets[item.widget] = null;
>                               item.fnc();
>                       }
>               } else this.cancelarback = true;
>       }, this));
>
>
>
>        var page1 = new qx.ui.mobile.page.NavigationPage();
>        page1.setTitle("Page 1");
>        page1.addListener("initialize", function()
>        {
>          var button = new qx.ui.mobile.form.Button("Next Page");
>          page1.getContent().add(button);
>
>          button.addListener("tap", function() {
>            page2.show();
>          }, this);
>        },this);
>
>        var page2 = new qx.ui.mobile.page.NavigationPage();
>        page2.setTitle("Page 2");
>        page2.setShowBackButton(true);
>        page2.setBackButtonText("Back");
>        page2.addListener("initialize", function()
>        {
>          var label = new qx.ui.mobile.basic.Label("Content of Page 2");
>          page2.getContent().add(label);
>        },this);
>
>
>       page2.addListener("appear", function() {
>               this.apilarHashChange(page2, qx.lang.Function.bind(function(){
>                       page1.show({reverse:true});
>               }, page2));
>       }, this);
>        page2.addListener("back", function() {
>          this.desapilarHashChange(this);
>        }, this);
>
>
>        // Add the pages to the page manager.
>        var manager = new qx.ui.mobile.page.Manager(false);
>        manager.addDetail([
>          page1,
>          page2
>        ]);
>
>        // Page1 will be shown at start
>        page1.show();

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to