Re: [xwiki-users] Timed auto refresh a page

2011-05-31 Thread Eduard Moraru
Hi Nicolas,

You can use JavaScript by adding a JavaScriptExtension object to the 
page you want to refresh. In the content(Code) of the 
JavaScriptExtension object you can have something like:

function timedRefresh(timeoutPeriod) {
   setTimeout(location.reload(true);,timeoutPeriod);
}

document.observe('xwiki:dom:loaded', function() {
   timedRefresh(5000);
});

...and the page will periodically refresh every 5 seconds (5000 
miliseconds).

Using a META/ tag is not really possible from a page's content because 
it needs to be put in the head/ of the rendered HTML page and the 
content of a wiki page always ends up in the body of the HTML page. In 
order to do it, you would have to modify some templates (or 
alternatively use the 'Page Elements' section in the wiki Administration 
-- xwiki3.0) and you would need to make sure you will refresh only the 
pages you want to refresh, and not all the pages.

If you`re ok with JavaScript, this would be the cleanest option (IMO). 
Other options may exist.

Hope this helps,
Eduard


On 05/31/2011 04:04 PM, Nicolas Hernandez wrote:
 Hello,

 I am looking for doing a timed auto-refresh like a
 META HTTP-EQUIV=Refresh CONTENT=60

 How could it be possible a xwiki article. It dos not work inserted as html.

 But someting sexiest should be possible ?

 Thanx
 None
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users


___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Timed auto refresh a page

2011-05-31 Thread Sergiu Dumitriu
On 05/31/2011 04:03 PM, Eduard Moraru wrote:
 Hi Nicolas,

 You can use JavaScript by adding a JavaScriptExtension object to the
 page you want to refresh. In the content(Code) of the
 JavaScriptExtension object you can have something like:

 function timedRefresh(timeoutPeriod) {
 setTimeout(location.reload(true);,timeoutPeriod);
 }

 document.observe('xwiki:dom:loaded', function() {
 timedRefresh(5000);
 });

 ...and the page will periodically refresh every 5 seconds (5000
 miliseconds).

 Using aMETA/  tag is not really possible from a page's content because
 it needs to be put in thehead/  of the rendered HTML page and the
 content of a wiki page always ends up in thebody  of the HTML page. In
 order to do it, you would have to modify some templates (or
 alternatively use the 'Page Elements' section in the wiki Administration
 -- xwiki3.0) and you would need to make sure you will refresh only the
 pages you want to refresh, and not all the pages.

 If you`re ok with JavaScript, this would be the cleanest option (IMO).
 Other options may exist.

 Hope this helps,
 Eduard


 On 05/31/2011 04:04 PM, Nicolas Hernandez wrote:
 Hello,

 I am looking for doing a timed auto-refresh like a
 META HTTP-EQUIV=Refresh CONTENT=60

 How could it be possible a xwiki article. It dos not work inserted as html.

 But someting sexiest should be possible ?


Note that autorefreshes are very bad for accessibility, and they can 
frustrate users (like me), I would advise you against using them.

-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users