- This topic has 10 replies, 3 voices, and was last updated 13 years, 2 months ago by WiZaxx.
-
AuthorPosts
-
WiZaxxParticipantHello 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); }
support-michaelKeymasterTry 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’
WiZaxxParticipantHello …. 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.
SonamGyatoMembertry 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.
WiZaxxParticipantTHANK YOU.
Travelling now, checking as soon as I’m back.
WiZaxxParticipantfunction 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??
SonamGyatoMemberare 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.
WiZaxxParticipantI 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?
SonamGyatoMemberi 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”;}
support-michaelKeymasterWiZaxx, 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.
WiZaxxParticipantWhow… This is cumbersome!!
But it works, and yes you should address this ASAP 🙂
Thank you guys!
-
AuthorPosts