- This topic has 6 replies, 4 voices, and was last updated 11 years, 6 months ago by Rathinavel.
-
AuthorPosts
-
lemorlennyMemberI’m a bit confused,
from a main page I call a secondary page with:phoneui.gotoPage('m1-pagename');
command, I inserted in the secondary page the istruction:
alert("Hello");
inside and outside from any function present but the instruction it never fired.
In the forum I have read about use an hidden link placed inside the page to solve this
behaviour but I’m not sure to have really understood.
Can you explain a bit more about it?.Regards
Lenny
Unknown AuthorParticipantIn the postpagetransition function:
if currentpageId=='#m1-whatever' {dowhatever}
lemorlennyMember@1thinchip wrote:
In the postpagetransition function:
if currentpageId=='#m1-whatever' {dowhatever}
Thanks for your reply,
I tried this in my secondary page:phoneui.prePageTransition = function(currentScreenId,targetScreenId) { alert(currentScreenId); alert(targetScreenId); return true; } phoneui.postPageTransition = function(newScreenId) { alert(newScreenId); }
but no one alert will fired.
I call the secondary page programmatically with:function callpage() { [CUT] phoneui.gotoPage("m1-SecondaryPage",phoneui.transitions.slideLeft); }
The secondary page will called without error but no events fired.
Meanwhile I understand to think to the mobi pages like an unique page.Regards
Lenny
support-octavioMemberFrom your last post I guess you have added the alert code in a <secondaryPage>-www/secondaryPage_custom.js file, then, when you run your <MainScreen>.mobi the alert code(and all code in secondaryPage_custom.js) isn’t included automatically in your <MainScreen>-www/MainScreen_custom.js file. You need to move your code from secondaryPage_custom.js to MainScreen_custom.js see it working. Hope this helps
Unknown AuthorParticipantFor one thing, you’re using the wrong screen IDs – use the default <name>_custom.js as your model.
For another thing, you’re not specifying with an if statement when it should fire.
Rather than modifying your code for you, here’re some examples.
phoneui.postPageTransition = function(newPageId) { if (newPageId == '#m1-Settings_iphone4') {phoneui.preprocessDOM('#m1-Settings_iphone4');} }
phoneui.prePageTransition = function(currentPageId,targetPageId) { // add custom pre-transition code here // return false to terminate transition if (targetPageId == '#m1-Homepage_iphone4' && currentPageId == '#m1-SecondBlank4') {initialize();} }
lemorlennyMember@support-octavio wrote:
From your last post I guess you have added the alert code in a <secondaryPage>-www/secondaryPage_custom.js file, then, when you run your <MainScreen>.mobi the alert code(and all code in secondaryPage_custom.js) isn’t included automatically in your <MainScreen>-www/MainScreen_custom.js file. You need to move your code from secondaryPage_custom.js to MainScreen_custom.js see it working. Hope this helps
If I understood, all function in called pages will be never fired?
RathinavelMemberi used multipages widget in my project.
this is not useful in multipages widget.
Is there any other phoneUI functions I need to use?!?!
-
AuthorPosts