Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-2278 in a recent build.
  1. #1
    Ext JS Premium Member Steffen Hiller's Avatar
    Join Date
    Mar 2008
    Posts
    770
    Vote Rating
    28
    Steffen Hiller will become famous soon enough Steffen Hiller will become famous soon enough

      0  

    Default [RC1] Ext.app.History#back not working

    [RC1] Ext.app.History#back not working


    My first request would be to make the 'back' method public, since I find it very useful.

    Secondly, it's not trying to do the right thing and it's not working, see:
    Code:
        back: function() {
            this.getActions().pop().run();
        },
    It tries to run the last action, but it should run the previous action.
    Then, the 'run' method doesn't exist anymore, should be 'execute'.
    But this still doesn't change the URL, see below:


    Here's my override for now. All my controller actions use URLs, but it could be made smarter to work for actions without URLs.
    Code:
    Ext.define('MyApp.override.app.History', {
        override : 'Ext.app.History',
        
        back: function() {
            var actions = this.getActions(),
                previousAction = actions[actions.length - 2],
                app = previousAction.getController().getApplication();
            
            actions.pop();
            
            app.redirectTo(previousAction.getUrl());
        }
        
    });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Vote Rating
    827
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    We will take a look at it!
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jun 2009
    Posts
    47
    Vote Rating
    0
    curlybracket is on a distinguished road

      0  

    Default


    We're just coming along the same problem in touch 2.0.0 and the bug is not fixed yet. Seems like the same is true for the current 2.0.1.1 release. Are there any efforts to fix this issue?

    Additionally there's also a general conceptional problem with the app history. The behaviour is not really as expected on android devices using the native back button. The browser history is stepping back while the app history does not recognize the uri change and popping the last action from the stack. So when I navigate into some views and my history will not represent the current state when step backwards. The same is true for the browser built-in history.back and history.go(-X) methods.
    In conjunction with the NavigationView that's a huge pain. All this circumstances render the app history pretty useless.

  4. #4
    Ext JS Premium Member SimonFlack's Avatar
    Join Date
    Jul 2010
    Location
    Norway
    Posts
    241
    Vote Rating
    3
    SimonFlack is on a distinguished road

      0  

    Default


    Same problems here. Had to write my own back() function based on Steffens and handle empty actions array (I.e when navigating back to home view)

    Code:
    back: function() {
                    var app = myApp.app,
                          previousAction = app._history._actions[app._history._actions.length-2];
                         
                    if(previousAction){
                        app._history._actions.pop();
                        app._history._actions.pop();
                        app.redirectTo(previousAction._url);           
                    }else{
                        app._history._actions = [];
                        app.showHome();
                    }
                }
    Figured I would post this just incase others are having problems.
    Simon Flack
    CEO and UX Designer
    WhiteFox AS, Norway

    Web: www.whitefox.no

    Facebook: www.facebook.com/WhiteFoxAS

    Twitter: @WhiteFoxAS

  5. #5
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    10
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    I have incorporated Steffen's patch into the next release. Thanks for the report and fix.

  6. #6
    Sencha Premium Member
    Join Date
    Mar 2011
    Posts
    9
    Vote Rating
    0
    Macy Abbey is on a distinguished road

      0  

    Default It seems like this is still broken in ST 2.1

    It seems like this is still broken in ST 2.1


    Because the stack is only popped once, if you attempt to go back twice, it throws you into an infinite back loop of staying on the same page.

    If you pop the stack twice, everything works as expected.

  7. #7
    Sencha User
    Join Date
    Dec 2012
    Posts
    13
    Vote Rating
    0
    lelit is on a distinguished road

      0  

    Default Still not working in Touch 2.3

    Still not working in Touch 2.3


    It's a pity that even such simple things get not fixed properly, 1 year and half and several releases of the software after the problem was reported.

    Anyway, my simple solution is to implement a new “back()” function on the application instance that basically does

    Code:
    var history = this.getHistory();
    
    history.back();
    
    var actions = history.getActions();
    actions.pop();
    hth, ciao, lele.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."