Author Topic: Mark entry fields with small red cross  (Read 3606 times)

Benjamin Dasari

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 95
    • View Profile
Mark entry fields with small red cross
« on: June 12, 2017, 12:07:38 PM »
Purpose: Mark entry fields with a small red cross to either prompt for user input or highlight the field, etc.
A small red cross is displayed in front of the entry field. This can be achieved by calling the "cmdMark" function and passing parameters to it.

Liquid UI Code:
----------------------------------------------------------------------------------------------------------------------------------------------
Script File Name: SAPMV45A.E0101.sjs
----------------------------------------------------------------------------------------------------------------------------------------------
// Function to trim blank spaces at the end of the string
String.prototype.trim = function(){return this.replace(/^\s+|\s+$/g,'');}

function getString(strInput) {
   return (typeof(strInput) == 'undefined') ? "" : strInput.toString().trim();
}

function isBlank(strInput) {
   var strVal = getString(strInput);
   var blank = strVal == "";
   return blank;
}

// Function to mark entry fields with a small red cross
function cmdMark(fldName,nOffset,strIcon) {           
   if(isBlank(nOffset) || nOffset < 2) {
      nOffset = 3;
   }
   if(isBlank(strIcon)) {
      strIcon = '02';
   }

   var nRow = <'F['+fldName+']'>.row;
   var nCol = <'F['+fldName+']'>.column;
   text([nRow,nCol-nOffset],'@'+strIcon+'@');
}

// Liquid UI Interface
cmdMark("VBAK-AUART");      // Order Type



« Last Edit: June 29, 2017, 12:17:03 PM by Benjamin Dasari »