facebook

Reload whole app on a button click

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #351696 Reply

    pratiti
    Member

    I’ve fetched data from Database when app loads, now on a button click I’m deleting data from database, and at that point I want whole app to reload.
    How to do that?

    #351708 Reply

    Hi pratiti,

    You can return to your home screen adding this code after your delete logic:

    phoneui.gotoScreen ('#m1-screen2', 'NONE');

    Feel free to ping us if you have additional questions.

    #351714 Reply

    pratiti
    Member

    Hello,

    Thanks for your answer.
    But, I want to load whole app or particular screen, so that the data from database reloads.
    I tried using location.reload(), that reloads the page, but when trying that on device, because of location.reload(), app closes.

    Actually, I want to reload the data, as I want instant reflection of changes in other parts of app.

    #351729 Reply

    Hi,

    You can use the phoneui api to nav to your startup screen. But if you have additional re-initialization code that must run due to the db reset consider separating that code such that it can be used from multiple contexts. While this might not match up with your requirements here is a sample project that might give you some additional ideas: http://www.genuitec.com/support-genuitec/viewtopic.php?f=14&t=1858

    If this suggestion doesn’t help you, providing more info on the code organization and flow and a baby project could be helpful thereafter.

    #351797 Reply

    pratiti
    Member

    No that didn’t help, is there no way to reload the app and transit to a particular page?

    #351803 Reply

    Code_A
    Member

    I think your best bet would be to manually refresh the app with the new data through an update function. How are you loading the data initially? Can you utilize the same code to reload the data in the app?

    If you using multipage widget, here is on you transition:

    phoneui.gotoMultiPagePage('m1-<your-file-name>-multiPage', 'SET_PAGE', 'm1-<your-file-name>-page1', 'FADE');
Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Reload whole app on a button click

You must be logged in to post in the forum log in