View Source

h2. Overview
_Since 4.0_

You can use _icecore:idleMonitor_ tag to show the enclosed markup when the user has not interacted with the page for a period of time. The markup will be hidden again once the user resumes the activity.

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

h2. Getting Started

To use the _icecore:idleMonitor_ 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 tag to your page markup and define the interval (in seconds) after which the markup should be made visible:

{panel}
{code:xml|borderStyle=dashed}<h:body>
...
<icecore:idleMonitor interval="40">
<div style="color: red">
Your session is about to expire in 20 seconds!
</div>
</icecore:idleMonitor>
...
</h:body>
{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/idleMonitor.html].{tip}

{panel}
*interval* Use this attribute to specify the interval in seconds after which the enclosed markup is made visible. When not specified the used value is 20 seconds.
{panel}
{panel}
*userActiveEvents* (_Since 4.1_) Use this attribute to specify a space separated list of JS events used for detecting user activity (_blur_ and _focus_ events cannot be used since they do not bubble up). When not specified the default value is "keydown mouseover".
{panel}