OnlineStatus

Table of Contents

Overview

Since EE-4.0

The mobi:onlineStatus component renders an element that has its CSS class changed depending on what the online state of the browser. Also it provides attributes that can take Javascript code that is executed when browser goes online or offline.

Getting Started

To start using the online status component, simply place the mobi:onlineStatus tag inside a the body of the page and add the attributes for the on/off CSS classes and/or the Javascript code to be executed.

<h:body>
        <style type="text/css">
               .offlineBackground { background-color: red; }
               .onlineBackground { background-color: green; }
        </style> 

	<mobi:onlineStatus onlineStyleClass="offlineBackground" offlineStyleClass="onlineBackground"/>
</h:body>
<h:body>
        <script type="text/javascript">
            function offline(element) {
                element.innerHTML = 'Your browser is offline!'
            }
            function online(element) {
                element.innerHTML = '';
            }
        </script> 

	<mobi:onlineStatus onOnline="online();" onOffline="offline();"/>
</h:body>

Attributes

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.

The onlineStyleClass attribute specifies the CSS class applied to the component's root element when browser is online.

The offlineStyleClass attribute specifies the CSS class applied to the component's root element when browser is offline.

The onOnline specifies the JavaScript to be evaluated when the browser goes online. The 'element' argument passed to the callback code is the root element of the component.

The onOffline specifies the JavaScript to be evaluated when the browser goes offline. The 'element' argument passed to the callback code is the root element of the component.

Event Listeners

None.

Client Behavior Events

None.

JavaScript API

None.

Keyboard Support

None.

Known Issues

None.

Additional Resources

Sample Applications

This component appears in the following ICEfaces sample applications:

Tutorials

This component appears in the following ICEfaces tutorials:

None

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© Copyright 2018 ICEsoft Technologies Canada Corp.