Looper

Kalipso - Developing - Form - Controls - Type - Looper

A Looper is a Table with Controls. You can define the content of the Looper and it will repeat itself according to the number of the records to display. You can add records manually or through the database, just like a Table. A Looper can interact with the user through its Events. You should use a Looper when you need to present an item composed with information that needs to be displayed en separated fields (columns) and when you need them to be from various types or want to position them freely. Value - It has no value.

For the control in question, when opening its properties, the following window appears:

Depending on the control chosen, the properties are different.

Properties

Tab - General

  • Name - Name of the Control. This Name will be used to identify the Control throughout the Project. The name of the Control can only contain letters, digits or underscore (_).

  • Text - Not applicable to this control.

  • Description - Not applicable to this control.

  • Plane - Plane of the Form where the Control should be created. Check the Planes chapter for more information.

  • Visible - With this option selected, the control is (or is not) visible.

  • Enabled - With this option selected, the control is (or is not) enabled. It may be visible (previous option), but it may not be enabled. In this case an event associated with the control is not executed

Layout

  • X - x position of the Control from left

  • Y - y position of the Control from top

  • Width - Width of the Control.

  • Height - Height of the Control

In relation to all these layout options, it is possible to set this value in runtime via the “Set Property” Action. You can also retrieve this value in runtime via the “Get Property” Action.

Miscellaneous

  • Orientation - Allows you to choose the orientation for vertical or horizontal

  • Cell Width - Cell width. The default is 85.

  • Columns - Number of columns to insert

  • Cell Height - Cell Height. The default is 85.

Style Appearance

  • Background - Background color of the Control. You can set the color for the background.

You can set this value is runtime via the “Set Property” Action. You can retrieve this value in runtime via the “Get Property” Action.

On the right side of the Style section, you can choose templates with pre-defined styles or configurable ones. By clicking on this option, the following style possibilities for the label appear:

  • Styles

    • None

    • Base

Border

  • Border - Yes or No

Selection

  • Style - How to display to the user which cell is selected.

    • Border - A line is drawn around the cell

    • Background - The background of the cell is painted with the specified color

      • Selection color - Color of the line or of the background of the cell when it's selected

Tab - Content

Regarding the content to be inserted in this control, it can be divided into three types: nothing, tables or advanced SQL. Choosing a type, the information in the window changes by questioning different options. Thus, you can link controls to:

  • Nothing - The control will be empty by default but you can use "Looper Add Line" Action to populate it.

  • Tables - The control will be linked to a Database Table and the number of records will be the same as the source Database Table. For the data to be displayed, "Refresh Control" Action must be called.

    • Kalipso Syntax - A slightly different form of SQL. Everything remains the same but instead of single-quotes to enclosure string types, you should use double-quotes. When referring to Controls or Variables, quoting is not needed.

    • String Expression - A string expression who will be evaluated and the result is executed over the database. You are responsible by specifying a result with the syntax expected by the database. Quoting is also your responsibility.

    • Filter - "Where" clause to be applied in the "select" to the Database Table.

    • Order By - "Order By" to be applied in the "select" to the Database Table.

In the table of this option, these columns appear:

  • Table - Name of the table selected

  • Column - Name of the column selected

  • Target Control - Control that will receive the value of the selected column

  • Target Property - Property of the control that will receive the value of the selected column

In the table of this option, there is a set of columns on which the content is generated. Thus, when clicking on the add button (plus button) on the right side, and if you have not entered any data, the system alerts you to the following:

You must add controls to the Looper first.

In the same area you have two more buttons to edit the content entered or else to delete it.

  • SQL Advanced - You're able to define the query that fills the control. The query should return a column for each link.

    • Database Profile - Database connection over which the specified query should be executed. You only need to specify one if it's online.

    • Query - String expression who will be evaluated and the result executed over the database.

When you choose this option and if you have not filled in the previous data, the system alerts you: Do you want to convert the Source to SQL Advanced?

  • Links - Connections between the Looper controls and the database. You can define a link between any editable property of a control belonging to the Looper and the Database. When the source is set to "Database Table", the link source is a Column. When the source is set to "SQL Advanced", the link source is the index of the returned column in the query.

Tab - Relations

This option allows you to define the relation between tables selected as source in Content. Suggested use of this option: Assume the following database:

Products

Families

Code

Code

Name

Name

Price

Assume the following properties of your Table (Grid): Link Control to: Database Table

Links:

Table

Column

Products

Name

Products

Price

Families

Name

Relations:

Products

Families

Code

Code

Tab - Actions

For each control, actions can be associated. For this, with the control selected, it is possible to access this tab and associate an action to the control. For more information on the actions available and how to use them click here.‌‌‌‌

In order to save and use this control, you must, in the content tab, establish the source of the data. If not, Kalipso will not allow you to save.

Shortcuts‌‌

  • F2 - Actions

  • F3 - General Properties

Last updated