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

This function creates a new element and places it on a Genie or a Rich Display File screen.

Parameters:

  • row - the row number to move the element to; the row may be a decimal number; this parameter is only applicable to Genie screens; it should not be passed if the API is used in a Rich Display File application
  • col - the column number to move the element to; the column may be a decimal number; this parameter is only applicable to Genie screens; it should not be passed if the API is used in a Rich Display File application
  • type - optional element type, such as "div", "input", "button", or "img" (if not passed, "div" is assumed)
  • content - optional content (innerHTML for div, value for input field, src for image)
  • id - optional element id

Example:

The following illustrates various ways to use the newElement() API.

// Adding elements to a Genie screen
var elemObj = newElement(3, 10);

var elemObj = newElement(3, 10, "div" ,"Press Enter to Continue.");

var elemObj = newElement(3, 10, "input");

var elemObj = newElement(3, 10, "img", "/images/logo.gif");


// Adding an element to a Rich Display File application screen
var button = newElement("button", "Click to continue");
button.style.top = "100px";
button.style.left = "100px";
button.onclick = function() {
  pui.click();
}
  • No labels