facebook

[SOLVED] gotoPage() API, help with syntax

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

    WiZaxx
    Participant

    Hello again.
    I’m trying to alter the behavior of a “Next button” but I cannot find the right syntax to use to navigate to a specific page.

    I was naifly hoping that this could work, but I guess I’m off to a long night without your help.

    
    function checkPass()
      {
      phoneui.gotoPage(m1-error,slideLeft);
      }
    
    #318880 Reply

    support-michael
    Keymaster

    Try gotoPage(‘m1-error’,’FLIP_LEFT’) or whatever transition effect you like. The transition effects are:

    NONE
    FADE
    FLIP_LEFT
    FLIP_RIGHT
    SLIDE_LEFT
    SLIDE_RIGHT
    SLIDE_UP
    SLIDE_DOWN’

    #318887 Reply

    WiZaxx
    Participant

    Hello …. again!

    This is the most basic function I can think of and yet I can’t get to to work … my dumbness must have reached stellar proportions 🙁
    BTW, I have tried with and without the phoneui.

    I have attached a pic to make sure I describe it as it is.
    Any other pointer?

    Attachments:
    You must be logged in to view attached files.
    #318888 Reply

    SonamGyato
    Member

    try this

    phoneui.gotoPage( “m1-???”, phoneui.transitions.slideLeft );

    where ??? is the filename of the new mobi page.

    i would put an

    alert(‘test’);

    just before the goto – to make sure that it’s being called.

    both the mobi files have to be in the same folder.

    #318931 Reply

    WiZaxx
    Participant

    THANK YOU.
    Travelling now, checking as soon as I’m back.

    #319190 Reply

    WiZaxx
    Participant
    function checkPass()
      {
      alert('before'); 
      phoneui.gotoPage('m1-error',phoneui.transitions.slideLeft);
      alert('after'); 
      }

    The code above is not working 🙁

    I have the pages on the same directory and I get both alerts (before and after) but no page change at all.

    Any other idea??

    #319193 Reply

    SonamGyato
    Member

    are you getting the ‘before’.

    if not, checkPass() is not being called.

    open up the debugger and console (at the bottom)
    and look for any errors.

    #319194 Reply

    WiZaxx
    Participant

    I get both before and after alerts.

    I also see a “page not found” error in the consolle but the page is in the same folder ?!?!

    What do you think is going on?

    #319196 Reply

    SonamGyato
    Member

    i think i know the problem.

    from within your app, are you making a reference to the
    error.mobi page. that is from a button etc.

    otherwise you’ll have to do this.

    i created a dummy page from which i make references to
    all the pages and images that i reference dynamically.

    then on your main app page, create a button
    (e.g. id XYZ).

    on this page make references to all the dynamic resources.

    then on your

    phoneui.documentReadyHandler = function()
    {
    // hide the button that you created on the main mobi
    // page that’s references the other pages/images
    //
    document.getElementById(“XYZ”).style.display = “none”;

    }

    #319197 Reply

    support-michael
    Keymaster

    @everest @WiZaxx

    WiZaxx, I made the same conclusion as everest, that most likely your error page is not being included in the code export of you app because it is not explicitly referenced in a Link property of your main page or a descendant page linked from the main page. We realize this is a goofy approach and it is being addressed in then next 1-2 releases.

    As everest identifies you can force all of your pages to by creating a dummy page that is linked to from the main page. Here is a simple technique I used in the Custom Actions Demo I posted yesterday. In the page-1 design I added 2 Link components at the bottom of the page. These Link components are “linked” to page2 and page3 design files. I hide the Links by deleting all of the text such that they have zero width.

    #319220 Reply

    WiZaxx
    Participant

    Whow… This is cumbersome!!

    But it works, and yes you should address this ASAP 🙂

    Thank you guys!

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: [SOLVED] gotoPage() API, help with syntax

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