online event
- Last Updated: March 30, 2020
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
Fires when the current JSDOSession object detects that the device on which
it is running has gone online after it was previously offline, or that the web application
to which it is connected is now available after it was previously unavailable.
This event always fires when the device on which the JSDOSession object is created goes online after having been offline (that is,
the device is reconnected to the network). For this event to fire when the web application
to which it has been connected is now available after having been unavailable, the JSDOSession object must have previously:
- Been instantiated using
getSession( ) - Not been disconnected from the web application using the object's
logout( )method - Detected an
offlineevent as a result of sending a Data Object Service request to the web application or executing theping( )method
Applies to: progress.data.JSDOSession class
Syntax
The following parameters appear in the signature of any event handler (callback) function (or functions) that you subscribe to this event:
|
- session
- A reference to the
JSDOSessionobject that has detected the online condition. - request
- If the online condition was detected as a result of a request sent on
behalf of a JSDO, this is a reference to the
requestobject used to make the request. For more information, see the description of the request object. If the online event is the result of the device itself coming back online or because of a call to theping( )method (either directly or because thepingIntervalproperty is set greater than 0), this parameter isnull.
This event can fire because:
- The device on which the app is running was previously offline (in
airplane mode or could not connect to a Wi-Fi network), but is now online again.Note: This condition will fire the
onlineevent on aJSDOSessionobject. - A
JSDOSessionobject that previously fired itsofflineevent because of a failed attempt to contact a Data Object Service has now been used successfully to contact that same Data Object Service.
Example
The following code fragment subscribes the function, onSessionOnline, to
handle the online event fired on the session,
mySession:
|
See also:
connected property, login( ) method (JSDOSession class), logout( ) method (JSDOSession class), offline event, ping( ) method (JSDOSession class), subscribe( ) method (JSDOSession class), unsubscribe( ) method (JSDOSession class)