Liquid UI - Documentation - 4.06 Reebok Object

4.06 Reebok Object


Purpose

A Reebok object is the other method to run WS commands. Reebok object is placed inside the WS scripting. All the inputfields are converted into Reebok object type to interact with different control on screen. All the scripts have .sjs extension and have the definition for Reebok, screen classes, and special definitions for onUIEvents object.


Syntax

var a = new Reebok('field');

or

Access to Reebok model via special convention <>

var a = <'field'>


Properties

  • field – name of the field or screen element that appears on the screen


Running WS Scripts through Rebook object

function Screen.prototype.command()

{

//…//

}


Sample Scripts

del

  1. The syntax for del command using reebok object is as follows:

  2. var ob = Reebok(field);
    ob.del();
  3. The following is an example of del command on va01 transaction for deleting the Group Box.

  4. var ob = <"G[Organizational Data]">; 
    ob.del();
  5. As per the code, the Organizational Group Box is deleted from the screen.

boxsize

  1. The syntax for Boxsize command using reebok object is as follows:

  2. Reebok(field).setsize(tarsize);
  3. The following is an example of Boxsize command on va01 transaction for resizing the Group Box.

  4. <"G[Organizational Data]">.setsize([12,50]);
  5. As per the code, the Group Box is re-sized to 12 rows and 50 columns.

link

  1. The syntax for link command using reebok object is as follows:

  2. Reebok(variable).link(field);
    
  3. The following is an example of link command on va01 transaction for comparing the inputfield value before and after input through an additional variable to save the value before input.

  4. Reebok("V[punil]").link("F[Sales Office]");
  5. As per the code, the value of Sales Office field is set to a variable.

pos

  1. The syntax for pos command using reebok object is as follows:

  2. var ob = Reebok(field);
    ob.pos = {'field':field, 'offset':targpos, 'processingGroup': bProcessingGroup, 'miscOptions':obMisc};
  3. The following is an example of pos command on va01 transaction for positioning the Group Box.

  4. <"G[Organizational Data]">.pos = {field:"F[Division]", offset:"[12,12]"};
  5. As per the code, the Group Box is positioned at offset[12,12].

setcursor

  1. The syntax for setcursor command using reebok object is as follows:

  2. Reebok(field).setcursor(obMisc);
    
  3. The following is an example of setcursor command on va01 transaction for placing the cursor in desired field.

  4. <"F[Division]">.setcursor();
  5. As per the code, the cursor has set to Division field.

noinput

  1. The syntax for noinput command using reebok object is as follows:

  2. Reebok(field).noinput(obMisc);
    
  3. The following is an example of noinput command on va01 transaction for making the inputfield as non-editable.

  4. <"F[Distribution Channel]">.noinput();
  5. As per the code, the Distribution Channel field cannot be edited.

nodropdownlist

  1. The syntax for nodropdownlist command using reebok object is as follows:

  2. Reebok(field).nodropdownlist();
    
  3. The following is an example of nodropdownlist command on MM01 transaction to remove the dropdownlist for the inputfield.

  4. <"F[Industry sector]">.nodropdownlist();
  5. As per the code, the dropdownlist for Industry Sector is removed.

numerical

  1. The syntax for numerical command using reebok object is as follows:

  2. Reebok(field).numerical = true;
    
  3. The following is an example of numerical command on va01 transaction to restrict the input type to accept only numerical values.

  4. <"F[Sales Group]">.numerical=true;
  5. As per the code, the Sales Group field will only accept numerical values.

uppercase

  1. The syntax for uppercase command using reebok object is as follows:

  2. Reebok(field).uppercase = true;
    
  3. The following is an example of uppercase command on va01 transaction for converting the input type to uppercase from lowercase alphabetic characters.

  4. <"F[Order Type]">.uppercase=true;
  5. As per the code, the Order Type field will convert the lowercase letters to uppercase.

fieldsize

  1. The syntax for fieldsize command using reebok object is as follows:

  2. Reebok(field).setfieldsize(size, options);
    
  3. The following is an example of fieldsize command on MM01 transaction for reducing the size of the inputfield.

  4. <"F[Material]">.setfieldsize(5,{"scrollable":true});
  5. As per the code, the Material field size is reduced to 5, but can still enter the values to its original character length with scrollable option.

Tablewidth()

function Screen.prototype.tablewidth(field, iWidth) {\

    var ob = <field>;\

    ob.setsize([ob.bottom - ob.top, iWidth]);\

}\

 

Tip()

function Screen.prototype.tip(field, tip) {\

    var ob = Reebok(field);\

    if(ob.isBox)\

        Text([ob.top, ob.right-1],'@35\\\\Q' + tip + '@');\

    else {\

                var text = ob.name;\

                text.tip = tip;\

                if(!text.icon.length) text.icon = '0L';\

    }\

}\

 

Gettableattribute()

function Screen.prototype.gettableattribute(field, obMisc) {\

    var obAttrs = Reebok(field);\

    for(val in obMisc) {\

                eval(obMisc[val] + ' = obAttrs.' + val);\

}\

}\

 

Getfieldattribute()

function Screen.prototype.getfieldattribute(field, obMisc) {\

    var obj;\

    if(isTableColumn(field))\

                obj=TableColumn(field);\

    else\

                obj = Reebok(field);\

    for(val in obMisc)\

                eval(obMisc[val] + ' = obj.'+val);\

}\

Example

function Screen.prototype.numerical(field) {
println('numerical');

    if(isTableColumn(field))

                TableColumn(field).numerical = true;

    else

        Reebok(field).numerical = true;

}

numerical('F[Material');              

//turns into

  Reebok('F[Material').numerical = true;                  // property of reebok

  //alternatively, you can program it like this:

<F[Material]>.numerical = true; 

<'F[Material with space]'>.numerical = true;


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