Bug with Application.replace?

2 posts, 0 answers
  1. Rob
    Rob avatar
    2 posts
    Member since:
    Jun 2014

    Posted 17 Sep 2014 Link to this post


    I've been developing a mobile app with AppBuilder in Visual Studio using Kendo Mobile. There's a part of the application where the user navigates from a list of itemsto a detail of one item, which is itself two views of the same data with a tabstrip to navigate between them. However, I don't want the user to switch between them and then have to navigate back through the history stack to get back to the results, but to go back to the results page directly from either detail page.

    To get around this, I am using Application.replace when switching between the detail views. This works, however I have found a bug in the code for the router object (kendo.router.js), at least running in the simulator. While debugging through the Kendo code, I noticed the history stack wasn't being altered correctly and instead of the last item in the location stack being replaced, a new item was being added with an index of NaN.The replace function currently is:

    replace: function(to, silent) {
        this._navigate(to, silent, function(adapter) {
            this.locations[this.locations - 1] = this.current;

    Should this code be:

    replace: function(to, silent) {
        this._navigate(to, silent, function(adapter) {
            this.locations[this.locations.length - 1] = this.current;

    Also, I've found that following a call to Application.replace, navigating via the back button widget causes the hosting web view to be reloaded in the simulator and as a result the application gets completely reinitialised and all state is lost. I'm wondering if this is by design or is this a bug?

    I'm using kendo.mobile.min.js (Kendo UI Core v2014.2.909).

  2. Kiril Nikolov
    Kiril Nikolov avatar
    2543 posts

    Posted 22 Sep 2014 Link to this post

    Hello Rob,

    Thank you very much for bringing this up to our attention.

    I have logged this in our github repository, and it will be reviewed and fixed. You can keep track on the progress here:


    As for the second problem that you are reporting - I am not really sure what exactly is the setup that you are describing. Are you using both backbutton and application replace? If this is the case, then please note that combining both options is not supported. If its some other scenario - please provide a runnable sample that we can look at.

    Thank you for your cooperation.

    Kiril Nikolov

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

Back to Top