facebook

phoneui.gotoPage is not working

💡
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 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #330721 Reply

    alonso100
    Member

    Hello,

    the instruction phoneui.gotoPage is a real mess and a headache !! When I assign it to a button in the event OnClick it works some times, some times it doesn´t and sometimes when it works then it doesn´t work.

    I have 3 buttons on a toolbar. To button1 I assigned

    phoneui.gotoPage('m1-page1', 'DEFAULT');

    and to button2 I assigned

    phoneui.gotoPage('m1-page2', 'DEFAULT');

    Unfortunately this worked rarely. After testing a lot I discovered first that it is case-sensitive. It is not the same page2.mobi than Page2.mobi when calling the page.

    In the 3rd. button I assigned Go to Screen in the event OnClick for page3.mobi and reading the JS file, I found that the system generates this code:

    'action5':function() { phoneui.gotoPage('m1-page3', 'DEFAULT');

    This is Ok and it was so for the other 2 buttons.

    Now that I check the code again (because the damned code is not working as it did before) I see that the system generated these lines of code:

    action3':function() { var ex; try { eval('phoneui.gotoPage(\'m1-page1\', \'DEFAULT\');'); } catch (ex) { console.log(ex); };
    ; },
    'action4':function() { var ex;  try { eval('phoneui.gotoPage(\'m1-page2\', \'SLIDE_UP\');'); } catch (ex) { console.log(ex); };
    ; },

    So, what is the reason for this automatic change in code and why is it not working any more ?? I deleted the buttons, created new ones, assigned the JS code again and it still does not work.

    #330722

    Unknown Author
    Participant

    <message deleted by 1TC>

    #330755

    Hi alonso100,

    Maybe you set the onclick action for your button in “Go to Screen”, wich make that your secondary screens were added to project, once you change this to “Run Javascript” for navigate to your secondary screens with code, these are not added in the project at least that you used the link hack o you include them on “Additional Project Files”. Can you confirm this please?

    If my first idea is not the issue, you are probably dealing with a known issue of actions, once you generated a project and add more actions, sometimes this actions (action1,action2,action3,…) are replaced and the buttons have a undesired behavior. We have a fix for this and will be avail on next mobione update.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: phoneui.gotoPage is not working

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