- This topic has 6 replies, 2 voices, and was last updated 12 years, 8 months ago by Albatros78.
-
AuthorPosts
-
Albatros78ParticipantHi all,
I would like reload automatically one specific page of my project.
When the project is generated by MB1 we need to refresh the div which is corresponding to our page.I tried different solution with Ajax or other functions with no success.
Does anyone has a sample working fine ?
Wayne, what’s the exact syntax to do that into _custom.js file
Thanks a lot
support-michaelKeymasterThis function will relayout a screen: phoneui.preprocessDOM(screenId)
To find the screenIds in you html file look for all divs with the CSS class m1-root or just root
See attachment pageid.png
//Example: phoneui.preprocessDOM("m1-test");
Attachments:
You must be logged in to view attached files.
Albatros78ParticipantBut how to configure by example an automatic refresh each x second or minutes ?
support-michaelKeymasterAh! I’ve not thought about that in past. What is your scenario/story?
Perhaps a javascript timer e.g., (setTimeout(millis), clearTimeout(timerId) )?
For a multi-screen webapp, I don’t think http protocol could be used to refresh page at regular interval, e.g., <META HTTP-EQUIV=”REFRESH” CONTENT=”1″>
Albatros78ParticipantI continue to work with my chart library.
In fact the chart id designed by an external xml file which content any values to display my chart.
And the xml file can be updated by external script directly on the web server.So, the idea is to reload the div to display new values of my chart.
I’m not sure if the syntax <META HTTP-EQUIV=”REFRESH” CONTENT=”1″> works because this action reload ALL html file. In fact the complete webapp in this case.
And if I do that probably I go back directly to the home page and not on my specific page (different screen) into my webapp.
Thanks for your help.
Hope to be clear
Albatros78ParticipantHi Wayne,
I found how to fix my issue.
In fact my charting values are inside js file which is loaded into my html with an include like:
<script type=”text/javascript” src=”data/cylinder1.js” ></script>And the JS function is into my _custom.js file and displays charting with values read from the include at first loading
The difficulty is to reload this include automatically
I tried setTimeout javascript function but just my function is reload with same values at initial.To fix this issue I configure my function to get charting values not from a js file by include but directly from a XML file, read into my function
and now when I refresh my function the xml file is reloaded correctly at each time.Works fine. very nice
Just for info and how to reload automatically the function itself the syntax is:
function Myfunction();{
var t1;
t1=setTimeout(“Myfunction ()”,5000);}
Regards
Albatros78ParticipantWayne, one thing
With this solution, when I click on my “back” button I need to clear my timer with a command ClearTimeout(t1);
But what is the JS function to add into _custom.js file to execute thie command for each “back” action for any page.
Does a function like that exists:
phoneui.goBack = function(Goback)
Thanks for your help
-
AuthorPosts