We are having issues with our app giving us an [object, object] in our application. It is happening on both the device LiveSync and the simulator LiveSync. It seems that one of our views is not getting rendered. We consoled out our output to make sure we are hitting the function that is supposed to navigate to our view, but when we make a code change and save the LiveSync does a refresh and we get an [object, object] showing on our View and the console is giving us a 404 (Not Found) error. It is doing this on the Device too. So it is not only the simulator. It seems to be something with a 'Refresh' vs a 'Reload'.
BUT if we hit the 'Reload' on the simulator, the app View comes back. I have attached an image of the simulator.
It is really frustrating and annoying and we can't figure out why the navigate is not working on a refresh vs a reload.
Our code on how we are doing our view shows is below.
home.html
<div id="homeViewDefault" data-role="view" data-layout="offline" data-title="Home" data-after-show="OnHomePageInit"> LOADING HOMEPAGE</div>
<!--THIS DOES NOT TRIGGER THE 'data-show' ON homeViewOnline ON REFRESH BUT DOES ON RELOAD IN APPBUILDER SIMULATOR -->
<div id="homeViewOnline" data-role="view" data-layout="main" data-model="app.MemberInfo" data-title="Home" data-show="OnHomePageOnlineShow"> <div id="MemberCardHeaderOnline"> <div id="memberCardOnline"> <div data-template="memberTemplate" data-bind="source: MyMemberInfo"> <!--Member card x-kendo-template id="memberTemplate" renders here--> </div> <div id="BarcodeOnline">Barcode no rendered</div> <img src="Images/ASTCLogo.png"/> </div> </div> <!--Home page button list--> <div id="homeNavigationOnline"> <ul data-role="listview"> <li> <a href="views/mymembership.html" data-role="touch" >My Membership</a></li> <li> <a href="views/catalyst.html" data-role="touch" >Catalyst</a></li> <!--Only need to show this if they have tickets redeemed--> <li> <a href="views/mytickets.html" data-role="touch">My Tickets</a> </li> </ul> </div></div>
home.js
var app = app || {};function OnHomePageInit() { if (app.helper.isNetworkPresent()) { console.log('network is present. On HomePageInit'); if (app.helper.getSettings("MemLevel") === "AddOn") { app.mobileApp.navigate("#homeViewAddOn"); } else { app.mobileApp.navigate("#homeViewOnline"); console.log("navigate to #homeViewOnline"); } } else { console.log('network is NOT present'); app.mobileApp.navigate("#homeViewOffline"); }};//***THIS DOES NOT RUN AGAIN ON REFRESH BUT DOES ON RELOAD OF APPBUILDER SIMULATOR****//function OnHomePageOnlineShow() { // app.mobileApp.showLoader(); //runs when Homepage View shows or is navigated to console.log('showing online View');};
We just don't want this to happen when we release the app to our users.
Anyone a Telerik help us. You can take a look at our project to if you need to, to reproduce it.