- This topic has 2 replies, 2 voices, and was last updated 12 years, 9 months ago by
vasanthns.
-
AuthorPosts
-
vasanthnsMemberHi,
phoneui.documentReadyHandler works fine while we launch a given MobiOne screen. But the same functions in the Custom Javascript files are not being called while navigating screen-to-screen using “Go to Screen” actions. Could you please check and help me.
to add more information,, assume I have two “interlinked” screens (using Actions) called “Home”, “Explorer” and both has some code in phoneui.documentReadyHandler of it’s respective Custom.js files – the JS code is executed if we “launch” either of these screens from Design center. But the same code is not called if we navigate from one screen to another using the Actions. To reproduce, Launch Home and click a Button in Home screen to go to Explorer (in this case the custom JS code in Explorer is not being invoked).
thanks & regards,
Vasanth.
support-michaelKeymaster> But the same functions in the Custom Javascript files are not being called while navigating screen-to-screen using “Go to Screen” actions. Could you please check and help me.
This is correct as there is no document being loaded between screens. The screens are merged into a single DOM. The documentready function is call only once when the webapp is initially loaded. Thereafter other the phoneui.prePageTransition() and phoneui.postPageTransition() callbacks are called when navigating between screens. You can find stubbed implementation of these 2 functions in the <project>_www/<project>_custom.js file.
Also note there is only 1 <project>_custom.js file and it is found in the www subdirectory of the .mobi start screen. Don’t get confused by any intermediate code that you may have generated while testing intermediate screens as it will never get called or be integrated into your app which generated from the start .mobi screen.
vasanthnsMemberThanks for the clarification, now I have moved all my Custom JS code in to my start Mobi screen’s Custom JS File, and everything works fine!!
regards,
Vasanth. -
AuthorPosts