Buttons

Creating a button on a detailed form

  1. Create a function to handle the button:

    1. Go to alt [Menu] > [Configuration] > [User defined functions].

    2. Click the button alt [Add…] in tabular form.

    3. Fill in the required fields: “Schema name”, “Function name”, “Return value data type”, “Function parameters”, “Function code”. Description of all fields in User defined functions.

      Use an object of the same type as the table as the input parameter of the function.

      For example:

      CREATE OR REPLACE FUNCTION detail_button(address)
        RETURNS text AS
      $BODY$
      BEGIN
        RETURN 'Нажата кнопка на детальной форме';
      END
      $BODY$
        LANGUAGE plpgsql VOLATILE SECURITY DEFINER
        COST 100;
      

    image

    1. Click the button alt [Create] to add an entry or a button alt [Cancel] to exit the add mode without saving data.

  2. Create a button:

    1. Go to alt[Menu] > [Configuration] > [Buttons] (or [Selected entity] > button alt [More] > the button alt [Setup…] > the container alt [Buttons]).

    2. Click the button alt [Add…] in tabular form.

    3. Fill in the required fields: “Identifier”, “Projection name”, “Schema name”, “Function”, *“Use in list” * in the value “false”. Description of all fields in Buttons.

      image

    4. Click the button alt [Create] to add an entry or a button alt [Cancel] to exit the add mode without saving data.

Creating a button in a tabular form

  1. Create a function to handle the button:

    1. Go to alt [Menu] > [Configuration] > [User-defined functions].

    2. Click the button alt [Add…] in tabular form.

    3. Fill in the required fields: “Schema name”, “Function name”, “Return value data type”,“Function Parameters”, “Function Code”. Description of all fields in User-defined functions.

      As the input parameter of the function, use an array of the same type as the primary key.

      Например:

      CREATE OR REPLACE FUNCTION table_button(text[])
        RETURNS text AS
      $BODY$
      BEGIN
        RETURN 'Нажата кнопка в табличной форме';
      END
      $BODY$
        LANGUAGE plpgsql VOLATILE SECURITY DEFINER
        COST 100;
      

      image

    4. Click the button alt [Create] to add an entry or a button alt [Cancel] to exit the add mode without saving data.

  2. Create a button:

    1. Go to alt [Menu] > [Configuration] > [Buttons] (or [Selected entity] > button alt [More] > the button alt [Setup…] > the container alt [Buttons]).
  3. Click the button alt [Add…] in tabular form.

  4. Fill in the required fields: “Identifier”, “Projection name”, “Schema name”, “Function”, “Use in list” in the value “true”. Description of all fields in Buttons.

image

  1. Click the button alt [Create] to add an entry or a button alt [Cancel] to exit the add mode without saving data.

Displaying a button on a detailed form by condition

Hiding and displaying the buttons: “Save”, “Add”, “Delete”.

  1. Go to [Selected entity] > button alt [More] > the button alt [Setup…].

  2. In the detailed form, click alt [Edit] to switch to edit mode.

  3. Enter in the field “Additional parameters” :

    {
      "button_visible": {
        "save": "condition",
        "add": "condition",
        "delete": "condition"
      }
    }
    
  4. Вместо Instead of “condition”, enter the value/expression for which the corresponding button should be displayed on the detailed form. Set several conditions for one button (if necessary):

    {
      "button_visible": {
        "delete": [
          {
            "field": "b1",
            "op": "EQ",
            "value": "c1"
          },
          {
            "field": "b2",
            "op": "EQ",
            "value": "c2"
          }
        ],
    ...
      }
    }
    

    The conditions are combined by the “AND” operation.

    The field “field” contains the name of the field, the value of which is used to identify the position of the button.

    The “op” field contains the operation to be performed. The values in this field can be:

    • “EQ” - is equal to;
    • “NEQ” - not equal to;
    • “ISN” - is equal to 0;
    • “ISNN” - not equal to 0;
    • “ANY” - is included in the array of values of the “value"field. At the same time, in the “value” field, it is necessary to list the values, if one of them matches, the condition will be fulfilled. For example:
         ...
         "op": "ANY",
               "value": [ 
                 "\"char\"",
                 "character",
                 "character varying",
                 "bit",
                 "bit varying"
               ]
         ...
    

    Operator support is expected:

    • “G” - more;
    • “F” - calling a function with the name corresponding to the value in the “field” field;
    • “FC” - is a special parameter for internal use. It is not used in this manual;
    • “EQF” - compares the value from the” field “field with the value from the” value “field;
    • “FEQ” - a special parameter for internal use. It is not used in this manual;
    • “L” - less;
    • “GEQ” - greater than or equal to;
    • “LEQ” - less than or equal to;
    • “C” - occurrence of the substring;

    The “value” field contains the value at which the condition will be met.

  5. Instead of a, b and c, enter:

    • instead of “a” - the name of the field (not the header) for which the check should be performed;
    • instead of “b” - an operation, when the condition is met, the button will be displayed;
    • instead of “c” - the value that will be used by the operation as a border.

    If there are several buttons that need to be hidden/displayed, then the lines are listed separated by commas inside the “button_visible” element.

  6. Click the button alt [Save] to save changes or click alt [Cancel] to exit the edit mode without saving.

Displaying a button on a detailed and tabular form without a condition

Hiding and displaying the buttons: “Save”, “Add”, “Delete” on the tabular and detailed form at the same time.

  1. Go to [Selected entity] > button alt [More] > the button alt [Setup…].

  2. In the detailed form, click alt [Edit] to switch to edit mode.

  3. Enter in the field “Additional parameters” :

    {
      "viewActions": {
        "allowAdd": false,
        "allowDelete": false,
        "allowSave": true
      }
    }
    

    The value “true” is to display the button.

    The value “false” is to hide the button.

  4. Click the button alt [Save] to save changes or click alt [Cancel] to exit the edit mode without saving.

Button activity

The “Save”, “Add”, “Delete” buttons can be active or inactive when certain conditions are met.

  1. Go to [Selected entity] > button alt [More] > the button alt [Setup…].

  2. In the detailed form, click alt [Edit] to switch to edit mode.

  3. Enter in the field “Additional parameters” :

    {
      "button_enabled": {
        "save": "condition",
        "add": "condition",
        "delete": "condition"
      }
    }
    
  4. Instead of “condition”, enter the value/expression at which the corresponding button will be active. Set several conditions for one button (if necessary):

    {
      "button_enabled": {
        "delete": [
          {
            "field": "b1",
            "op": "EQ",
            "value": "c1"
          },
          {
            "field": "b2",
            "op": "EQ",
            "value": "c2"
          }
        ],
    ...
      }
    }
    

    The conditions are combined by the “AND” operation.

    The field “field” contains the name of the field, the value of which is used to identify the status of the button.

    The “op” field contains the operation to be performed. The values in this field can be:

    • “EQ” is equal to;

    • “NEQ” - not equal to;

    • “G” - more;

    • “- “F” - calling a function with the name corresponding to the value in the “field"field;

    • “FC” is a special parameter for internal use. It is not used in this manual;

    • “EQF” - compares the value from the “field” field with the value from the “value"field;

    • “FEQ” is a special parameter for internal use. It is not used in this manual;

    • “L” - less;

    • “GEQ” - greater than or equal to;

    • “LEQ” - less than or equal to;

    • “C” - occurrence of the substring;

    • “ISN” - is equal to 0;

    • “ISNN” - is not equal to 0.

    The “value” field contains the value at which the condition.

  5. Instead of a, b and c, enter:

    • instead of “a” - the name of the field (not the header) for which the check should be performed;
    • instead of “b” - an operation, when the condition is met, the button will be active;
    • instead of “c” - the value that will be used by the operation as a border.

    If there are several buttons for which conditions need to be set, then the lines are listed separated by commas inside the “button_enabled” element.

  6. Click the button alt [Save] to save changes or click alt [Cancel] to exit the edit mode without saving.

The drop-down list is supplemented with link buttons:

  • the button alt opens a form for adding values to the drop-down list.
  • the button alt opens an additional form associated with the selected drop-down list item.
  1. Go to [Selected entity] > button alt [More] > the button alt [Setup…].

  2. In the detailed form, click alt [Edit] to switch to edit mode.

  3. Enter in the field “Additional parameters” :

    {
      "hideRefToDetail": "a"
    }
    
  4. Instead of “a”, specify “true” or “false” to allow or prohibit the display of the element, respectively.

    By default, the function has the value “false”.

  5. Click the button alt [Save] to save changes or click alt [Cancel] to exit the edit mode without saving.

Adding a group of radio buttons

image

A group of radio buttons is used to select one option from a group of mutually exclusive options.

  1. Add a new column to the entity (see more details in Adding a column). In the field “Type on display”, select the value “radiobutton”.

  2. Go to [Selected entity] > button alt [More] > button alt [Setup…].

  3. In the detailed form, click alt [Edit] to switch to edit mode.

  4. Specify the parameters:

    Method 1:

    1. Enter in the field “Additional parameters” :

      {
        "source-items": [
          "a1",
          "a2",
         ...
        ],
        "use-enumeration": "true"
      }
      

      The “source-items” field contains a set of button headers.

    2. Instead of a1, a2, enter the button headers.

    3. Specify “use-enumeration” (if necessary). The field “use-enumeration”, set to “true”, saves the index of the selected element to the database: 1, 2, 3, etc.

    By default, “use-enumeration” has the value “false”.

    Method 2:

    1. Enter in the field “Additional parameters” :

      {
        "source-dictionary": [
          {
            "key": "b1",
            "value": "c1"
          },
          {
            "key": "b2",
            "value": "c2"
          },
         ...
        ]
      }
      

      The “source-dictionary” field contains a set of keys and button headers.

    2. Instead of b1, b2 and c1 c2, enter:

      • instead of “b1”, “b2” - values that will be entered into the database;
      • instead of “c1”, “c2” - button headers.
  5. Specify “null-option” (if necessary):

    {
       ...
       "null-option": "not specified"
       ...
    }
    

    The “null-option” field contains the button title. Clicking on the button will assign the value “null"to the group of radio buttons.

  6. Specify “columnOptions” (if necessary):

{
   ...
   "columnOptions": "1"
   ...
}

The “columnOptions” field contains the number of columns when displaying a group of radio buttons. Supported values are: 0 - in a row, 1, 2, 3.

  1. Click the button alt [Save] to save changes or click alt [Cancel] to exit the edit mode without saving.

The location of the buttons “Contextual actions”

image

By default, contextual actions are located in the “More” panel. This function allows you to set the location for contextual actions in the main window.

  1. Go to [Selected entity] > button alt [More] > the button alt [Setup…].

  2. In the detailed form, click alt [Edit] to switch to edit mode.

  3. Enter in the field “Additional parameters” :

    {
      "actionsFilter": {
        "a": "main"
      }
    }
    

    Instead of a, specify for which context action to change the location to the main window:

    Contextual action Description
    showTableFilter alt [Filter]
    showTableSummary alt [Summary]
    exportToHtml alt [Export to HTML]
    exportToPdf alt [Export to PDF]
    exportToExcel alt [Export to Excel]
    report [Report…]
    reload alt [Refresh]
    showConstructor alt [Table designer]
    openPivot [Analyze…]
    importFromClipboard alt [Import from clipboard]
    editVersions [Export request to console]
    settings alt [Setup]
  4. Click the button alt [Save] to save changes or click alt [Cancel] to exit the edit mode without saving.