Author Topic: Use gettableattribute for Liquid UI table  (Read 2235 times)

Leo Chu

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 16
    • View Profile
Use gettableattribute for Liquid UI table
« on: June 20, 2017, 02:04:15 PM »
Liquid UI: Use gettableattribute for Liquid UI table

This example is to use gettableattribute command for Liquid UI table.
By using the command, it returns the first visible row, last visible row, and last row numbers of the table.


Step 1: Create user interface
clearscreen();

//Button to trigger action
pushbutton([1,15], "Get Table Attribute", "?", {"process":getLUITableAttribute, "size":[1,20]});

//Logic to render Liquid UI table
table([3,2], [15,50], {"name":"z_table", "title":"BOM Detail", "rows":100});
column("Item", {"table":"z_table", "name":"item_no", "position":1, "size":4, "numerical":true});
column("Document", {"table":"z_table", "name":"doc_no", "position":2, "size":25, "uppercase":true});
column("Type", {"table":"z_table", "name":"doc_type", "position":3, "size":3, "uppercase":true});
column("Part", {"table":"z_table", "name":"doc_part", "position":4, "size":3, "uppercase":true});
column("Version", {"table":"z_table", "name":"doc_version", "position":5, "size":2, "uppercase":true});



Step 2: Create function to get table attribute
//Function to get table attribute
function getLUITableAttribute(){
   gettableattribute("z_table", {"firstvisiblerow":"FVisRow", "lastvisiblerow":"LVisRow", "lastrow":"LRow"});
   println("=====>> FVisRow:"+FVisRow);
   println("=====>> LVisRow:"+LVisRow);
   println("=====>> LRow:"+LRow);
}


After execution, FVisRow, LVisRow, and LRow will carry the value and able to be checked in Cornelius window by using println commands.


Note: To get table attribute for Liquid UI table, the getableattribute command needs to be used before the first onscreen section.
            Or use it directly in a pure JavaScript function or in the screen script when the table is actually rendered.


            

See attachments for script example