Versions Compared

Key

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

The pui.onload validate event, if defined, fires after each Rich Display Record Format is rendered.  It is executed right before the screen's onload event.The pui.onload method does not fire on Genie screens.  For Genie screens, use the global customize() and afterLoad() events insteadfor each input value that is modified on a Rich Display File screen and submitted back to the server.

The event can modify the value being sent to the server by returning a new value as a string.

The event can cause a validation message to occur by returning an object with a property named "msg", which will contain the message to display.

The event can bubble up to normal Profound UI processing by returning null.

Parameters:

The pui.onload validate event receives one parameter object that has the following properties:

  • file - display file name
  • library - display file library
  • name - record format name
  • metaData - meta data for the screen definition, including screen-level properties and properties for each element
  • data - name/value pairs of the data rendered on the screen
  • ref - reference field information objectvalue - the value being submitted to the server
  • fieldName - the name of the field being modified
  • dataType - the field data type
  • dataLength - data length (only present if the field is a character or a numeric field)
  • formatting - field formatting

Example:

Code Block
javascript
javascript
pui.onloadvalidate = function(configobj) {

  // Position the footer based on the current screen height

  var footer = getObj("myfooter");  // get a reference to the footer div
  var footerTop = pui.getRuntimeContainerHeight() + 20;  // calculate footer top position based on runtime container height
  footer.style.top = footerTop + "px";  // assign the new top positionif (obj.dataType == "indicator") {
    if (obj.value == "true" || obj.value == "1") return "1";
    else if (obj.value == "false" || obj.value == "0") return "0";
    else return { msg: "The selection is not valid for an indicator." };
  }
  else {
    // bubble up
    return null;
  }

}