Page tree
Skip to end of metadata
Go to start of metadata

The pui.onoffline event, if defined, fires when Profound UI cannot make a connection to the server.  It can be used to launch an alternate offline process allowing the user to work locally until a connection is restored.  If the event is not defined, a simple alert message is displayed notifying the user that the connection has been lost.

Example:

pui.onoffline = function() {

  // Show screen from an alternate (offline) Rich Display File
  pui.show({
    // this line assumes that the alternate display file has been preloaded into an object called myDspfObj
    meta: myDspfObj,


    // alternatively, the display file can be packaged locally within a PhoneGap project
    // the following assumes a display file named mydspf.json has been placed in the same PhoneGap directory as index.html
    //path: "mydspf.json"

    // other config options can be specified here, such as which format or screen to display and what data to pass to the screen
    // if not specified, the first screen is displayed and no data is passed to it


    handler: function(response) {
      // the user's response to the screen can be handled here
    }
  });

}