Author Topic: Using 'del()' as a Method  (Read 6703 times)

Sai Siddhartha

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 47
    • View Profile
Using 'del()' as a Method
« on: November 02, 2017, 09:00:30 AM »
Purpose:
Using 'del()' command as an object method to remove element of the referenced object.
The syntax would be as follows:

var objectName = <'[screen_control]'>;
objectName.del(); 

Below example demonstrates the 'del()' with object method on MB51 screen.

LiquidUI code
//////////////////////////////// RM07DOCS.E1000.sjs ////////////////////////////

for(a=firstChild; a!=null; a=a.nextSibling)   
a.del();

You will find the all the elements on screen deleted.

Note:
Using the 'del()' method with radiobuttons may return an error in certain situations.
If this happens, use the standard 'del()' command instead of the object method to delete the element as shown in the following example.

radiobutton([6,15], "Test 1", {"name":"testbutton1", "F[Field_name]":'001'});
radiobutton ([6,37], "Test 2", {"name":"testbutton1",  "F[Field_name]":'002', "default":true});
box([4,8], [8,55], "Group");

See the attachment for screenshots