facebook

refresh button

đź’ˇ
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

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

    Gaia
    Member

    I would love create a button to refresh the page. On the Widget buttons is it possible to deposit a script code – has someone an idea, how this script does look like?

    Thank you in advance for your help.

    Gaia

    #334408

    support-michael
    Keymaster

    @Gaia

    Can you provide more details on the context of how refresh would need to work?

    For example:
    1) is the page a form in which you would like the fields reset
    1a) if no, can you describe what would cause a screen to be dirty such that it needs to be refreshed? I’m generally curious.

    2) are you creating a native app or a simpler html webapp?

    #335244

    Gaia
    Member

    Dear Wayne

    Thank you for your replay – I’m really pleased!
    No, the page to refresh isn’t a form.
    I wrote a code for a “random text generator”, the user can click on a button (on Page 1) and he gets a joke (on Page 2). But I would love to put a button on the page (also on Page 2) to refresh it and the customer generates a next joke.

    Do you have any Idea?

    Regards
    Gaja

    #336704

    Gaia
    Member

    No help? Does anybody have an idea?

    Please!

    Gaia

    #336708

    Brandon
    Member

    You would just need to call the same function inside the button. You can use the run javascript action in the button to do this.

    #336712

    Gaia
    Member

    Dear CincyPlanet

    Thank you for your answer, but exactly that was my question – I would love to use the run java script action in the button to refresh the page, but I have no idea how to write the script for the native.
    Simple: I was asking for a script to refresh the page.

    Can you help me?

    regards
    Gaia

    #336971

    Muhammad
    Member

    How if use reload page?

    <input type=”button” value=”Reload Page” onClick=”history.go(0)”>

    or

    <input type=”button” value=”Reload Page” onClick=”window.location.href=window.location.href”>

    or

    <input type=”button” value=”Reload Page” onClick=”window.location.reload()”>

    #336974

    nvts
    Member

    I think this is what you are asking?

    This is how I refresh my text fields in Mobione:
    1. Create a button in your screen
    2. Set the On Click Actions for that button to run Java Script.
    3. In the code section enter: refreshScreen();
    4. Save the button.

    Now you need to add the code for the refreshScreen function.

    Put this in your app_custom.js file after all the Mobione code:

    function refreshScreen() {
    $(‘#m1-entry-FirstName’).val (”);
    $(‘#m1-entry-LastName’).val (”);
    $(‘#m1-entry-Phone’).val (”);
    $(‘#m1-entry-Email’).val (”);
    }

    The above code is – m1=MobiOne – entry=Screen Name – FirstName is the id for the field

    Now add or delete the other fields if you do not have them in your mobi app.

    Cheers…

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: refresh button

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