Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This function allows you to show a Rich Display File screen outside of the normal Profound UI session flow. It can be used to build stateless or offline applications.

Parameters:

  • config object - JavaScript object containing configuration properties

Configuration Options:

  • path - path to an IFS file, local file packaged within PhoneGap, or any URL containing the meta definition of a Rich Display File; can also point to a DDS source member using the format LIBRARY/FILE(SOURCE)

  • method - HTTP method used to retrieve the path (optional); if not specified, the "GET" method is used

  • meta - JavaScript object containing the meta definition; used as an alternative to path

  • screen - the name of the record format to display

  • screens - an array of formats to display at one time; used as an alternative to format

  • data - JavaScript object containing the name/value pairs of the data to populate to the screen

  • handler - JavaScript function to handle the response from the user; the function will receive a response object containing name/value pairs for response data, including input filled out by user and any buttons or hyperlinks clicked on by user

  • transition - provides a screen transition animation by specifying an object with the following properties:

    • animation - identifies the CSS class for the screen transition animation (e.g. slide-right, slide-left, slide-down, slide-up, fade, zoom-in, zoom-out); required for the transition effect

    • screen - specifies whether the previous screen is animated away to reveal the new screen ("previous") or the new screen is animated on top of the previous screen ("new"); applicable only when the animation property is specified; if not specified, the default value is "new"

    • overlay - determines if both the previous and the newly rendered screen should remain after the animation completes; this is useful in presenting a mobile pop-up menu screen or similar; applicable only when the animation property is specified; applicable only when the animation property is specified; defaults to false if not specified
      These properties override the Transition Animation properties defined in the Rich Display screen definition. 

  • container - alternate DIV container to render the display into

Example:

The following function displays the Hello World record format without any RPG coding, using JavaScript only.

javascript
Code Block
javascript
var data = { "TXTNAME": "" };  // initialize data for the screen

function hello() {

  pui.show({
    //path: "/helloScreen.json",  // get meta definition from IFS path
    path: "PUISAMPLES/QDDSSRC(HELLO002D)",  // get meta definition from DDS source member
    data: data,
    handler: function(response) {
      pui.applyResponse(data, response);  // update data object based on response 
                                          //so that the data redisplays when the screen is shown again
      if (response["BTNEXIT"] == "1") {  // exit button was pressed
        alert("Good Bye");
        document.body.innerHTML = "";  // clear the screen
      }
      else {
        data["NAME"] = "Hello " + data["TXTNAME"];  // greet the person
        hello();  // redisplay the screen
      }
    }
  });

}

...