Michael Brandon
Posts: 0
Joined: Mon Apr 21, 2014 9:17 pm

Why does opening a dialog clear the page underneath it?

I just packaged a new APK and installed it on my device.

Currently, I have my "loginPage" set as the "start page" in my app settings. Once a user logins in or registersNewUser, onSuccess I have it set to navigate to homePage "use full refresh". But when I close the App down from my Android task manager and relaunch it, the app DOES NOT maintain the User Session and DOES NOT open to the homePage. Would you like for me to provide the APK file for you to test? Or I can give you access to my project.

Let me know. Thanks.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Why does opening a dialog clear the page underneath it?

Michael,

In "App Setting" - "General" field "Start page" means page which will appear first in your application. And this page will be "main" page of your application. "Main" means that this page will be always in memory. For example if you have "MyStartPage" as "Start page" and two pages "First" and "Second". And from "MyStartPage" you navigate to "First" page - in memory will be two pages: "MyStartPage" and "First" ones. Then you navigate from "First" page to "Second" one - in memory will be two pages: "MyStartPage" and "Second" ones.
But if you navigate from "MyStartPage" to "First" page with checked checkbox "Use full screen refresh" page "First" wil become "main" page of your application. And it will be always in memory.
So your page chosen as "Start page" in "App settings" will be appear first anyway. If you don't want this behaviour you should implement your own logic. For example, you can remember credentials in localstorage variable and use it after first login and send it automatically after first login

Michael Brandon
Posts: 0
Joined: Mon Apr 21, 2014 9:17 pm

Why does opening a dialog clear the page underneath it?

Thank you for clarifying the app's page memory and how it works. But when I set the "loginPage" as the startpage and users login with onSuccess navigate to homePage 'useFullRefresh' this homePage is NOT becoming the new "first page". When I close down the app and reopen it, no matter what, it ALWAYS launches to the "loginPage".

So, if I want to change this behavior as you suggested here;

"If you don't want this behavior you should implement your own logic. For example, you can remember credentials in localstorage variable and use it after first login and send it automatically after first login"

Maybe there is another workaround..

I've set my HomePage as the "startpage" in app settings. On my homePage I need to set TWO buttons. 1.Login and 2.Logout.

As a first time app user, the login button (navigates to the loginPage) would ONLY be visible and the logout button invisible. Once the user either logs in or registers, their sessionToken & UserID are mapped into local storage, and they navigate back to the homePage.

Here is where things get problematic with this workaround... How do I make the loginButton ONLY visible when nothing is stored in Local Storage and how do I make the logoutButton ONLY visible (and loginButton invisible) when a userSession is stored in Local Storage?

This logic would make more sense as oppose to setting start pages and app page memory page full refresh. No?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Why does opening a dialog clear the page underneath it?

Hello, Michael,

Your logic have sense.
For hiding and showing button you can create event "page show" and create such javascript code: if (localStorage.getItem("session") == null){
Appery("button_login_name").show();
Appery("button_logout_name").hide();
}else{
Appery("button_login_name").hide();
Appery("button_logout_name").show();
}

Michael Brandon
Posts: 0
Joined: Mon Apr 21, 2014 9:17 pm

Why does opening a dialog clear the page underneath it?

Awesome!! Thank you so much. This did the trick and I believe creates the best in UX.

You guys are great!

bahar.wadia
Posts: 0
Joined: Wed Aug 07, 2013 2:05 am

Why does opening a dialog clear the page underneath it?

Was a solutions identified for this issue?

I want to be able to open a Dialog on top of my page, have the user interact with it. Then when the user closes the Dialog all that should happen is the Dialog disappears and the user is returned to the underlying page. The page should not fire the Load. Otherwise all the underlying data reloads, which is useless.

Thanks for your help.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Why does opening a dialog clear the page underneath it?

Hello,

Dialog is essentially another page. When you close the dialog box and go to the previous page event pageshow triggers (and pageload if render in one HTML wasn't installed) You can track from what page was the transition (http://api.jquerymobile.com/pagebefor...) and if it was a transition from the dialog page, then do not call the update info on the page. Or you can use not a dialogue but popup (http://api.jquerymobile.com/popup/). By the way, the popup will be added in our new release.

bahar.wadia
Posts: 0
Joined: Wed Aug 07, 2013 2:05 am

Why does opening a dialog clear the page underneath it?

Thank you. That makes sense. When is the next release with Popups scheduled for release ?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Why does opening a dialog clear the page underneath it?

Hi Bahar,

In the end of July.

Mike6580064
Posts: 0
Joined: Wed Jan 15, 2014 6:00 pm

Why does opening a dialog clear the page underneath it?

How can I change the page color that's under the dialog box?

I understand that I'm supposed to utilize the data-overlay-theme attribute but I'm unsure of how and where to use this.

Say I'd like to make the page color #666666

Return to “Issues”