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

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

This function allows you to show a Rich Display File screen outside of the normal Profound UI session flow or in an offline state.

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)
  • meta - JavaScript object containing the meta definition; used as an alternative to path
  • format - the name of the record format to display
  • formats - 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
  • 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.

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

function hello() {

  pui.show({
    //path: "/helloScreen.js",  // 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
      }
    }
  });

}
  • No labels