This is a migrated thread and some comments may be shown as answers.

Bug with Application.replace?

1 Answer 44 Views
Report a bug
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rob
Top achievements
Rank 1
Rob asked on 17 Sep 2014, 03:46 PM
Hi,

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) {
        adapter.replace(to);
        this.locations[this.locations - 1] = this.current;
    });
},


Should this code be:

replace: function(to, silent) {
    this._navigate(to, silent, function(adapter) {
        adapter.replace(to);
        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).

Thanks,
Rob

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 22 Sep 2014, 07:20 AM
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:

https://github.com/telerik/kendo-ui-core/issues/306

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.

Regards,
Kiril Nikolov
Telerik
 

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

 
Tags
Report a bug
Asked by
Rob
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or