Liquid UI - Documentation - 19.12 Get attributes of a pushbutton

19.12 Get attributes of a pushbutton


Prerequisites

Purpose

This article demonstrates how to use the getfieldattribute command to display properties of the push button, including icon ID, tooltip, and label name. The following steps will guide you through the process.

  1. Delete the image container on the SAP Easy Access screen
  2. Add a push button to retrieve its attributes
  3. Add a function to showcase the attributes of a created push button.

User Interface

//Create this file inside your script folder for customizing the SAP Easy Access screen, SAPLSMTR_NAVIGATION.E0100.sjs
//Now, let's add the Liquid UI script to the above file and save it.

 

Customization

  1. Delete the image container on the SAP Easy Access screen using del().
     
    // Deletes the image container
    del("X[IMAGE_CONTAINER]");
    
     
     
  2. Add a push button with an icon and label it as Pushbutton attributes.
     
    // Creates a pushbutton with an icon, tooltip and label
    pushbutton([5,25], "@01\\QHELLO@Pushbutton attributes",{"process":printbutton});
    
     
     
  3. Add a printbutton function to retrieve and display attributes of the created push button on the console window.
     
    // Function to retrieve the push button attributes using getfieldattribute
    function printbutton(buttonName)
     {
     getfieldattribute("P[Pushbutton attributes]", {"name.icon":"fbuttonicon","name.tip":"fbuttontip", "name.label":"fbuttontext"});
     println("\t fbuttonicon = " + fbuttonicon);
     println("\t fbuttontip = " + fbuttontip);
     println("\t fbuttontext = " + fbuttontext);
     }
     

SAP Process

  1. Refresh the SAP Easy Access screen and click Pushbutton attributes. This displays the attributes of the push button on the console window, as shown below.
     
     


Next Steps

Get attributes of an inputfield
Learn how to obtain attributes of an inputfield.

10 min.

This article is part of the Invoking functions tutorial.

Display custom pop-up
Learn how to customize the pop-up screen as per your requirement.

10 min.

This article is also a part of the Interpreting function codes tutorial.


Can't find the answers you're looking for?