Author Topic: getfieldattribute() - with properties of field object  (Read 4053 times)

Sai Siddhartha

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 47
    • View Profile
getfieldattribute() - with properties of field object
« on: November 02, 2017, 05:10:22 AM »
Purpose:

To use properties of the field object as options in the fieldname command.

Field object properties:

name.label
Specifies the onscreen label of a given pushbutton or other screen element.
Columns in a table are excluded.
name.icon
For pushbuttons, this specifies the icon ID.
name.tip
For pushbuttons, this specifies the tooptip.

Below example demonstrates the getfieldattribute command to return pushbutton attributes.
the getfieldattribute command is used within a function to return the attributes of a given pushbutton. We will use the Head.data pushbutton in the MIGO screen and script is conditionalized based on the tooltip value obtained to display println statement on cornelius output window.

LiquidUI code:
///////////////////////////////////// SAPLMIGO.E0001.sjs ///////////////////////////////////
// function for fetching pushbutton properties with getfieldattributes command
function printButton(){
getfieldattribute("P[Head.data]", {"name.icon":"fbuttonicon", "name.tip":"fbuttontip",  "name.label":"fbuttontext"});  // getfieldattribute command
println("\t fbuttonicon = " + fbuttonicon);
println("\t fbuttontip = " + fbuttontip);
println("\t fbuttontext = " + fbuttontext);
}
printButton(); // function calling

//condition based on tooltip obtained to display println statement
 if(fbuttontip == "Open header data"){ 
      println("----------------button is visible--------------------");
 }