View Source

h2. Overview
_Since 3.1_

The _icecore:refresh_ tag allows a view to be periodically refreshed via ajax without requiring an asynchronous ajax-push connection to be held open.

{tip}See the ICEfaces Showcase [Live Demo|http://icefaces-showcase.icesoft.org/showcase.jsf?grp=aceMenu&exp=refreshBean] of this component, complete with source code.{tip}

h2. Getting Started

To use the _icecore:refresh_ tag, first declare the core namespace:

{panel}
{code:html|borderStyle=dashed}<html ... xmlns:icecore="http://www.icefaces.org/icefaces/core">
{code}
{panel}Then add the _icecore:refresh_ tag to your page markup. For instance, to cause the page to be updated every 10 seconds over the course of 2 minutes:
{panel}{code:xml|borderStyle=dashed}<h:body>
<icecore:refresh interval="10" duration="2"/>
...
{code}
{panel}
h2. Attributes
{tip:title=TagLib Documentation}This section covers attributes involved in the typical use-cases for this component. For reference, the complete taglib documentation for this component is available [here|http://res.icesoft.org/docs/v4_latest/core/comps/tld/icecore/refresh.html].{tip}

{panel}
*interval* - Update the page via ajax every _interval_ seconds.
{panel}
{panel}
*duration* - Update the page via ajax for _duration_ minutes.
{panel}

h2. Notes

The page will be updated every _interval_ seconds for a total time of _duration_ minutes.
If the page is refreshed by the user, the duration timer is restarted.
If the duration is not specified, or \-1 is specified, they are equivalent to an infinite duration, and the page will be periodically refreshed until the user leaves the page.
A duration of 0 is equivalent to disabling the control.