|
|
|
|
|
- Overview
- Initializing the different controls/attributes of a Looper control
- Retrieving the value of the different controls/attributes found in a Looper control
- Retrieving the value of the different controls/attributes of a row found in a Looper control
- Content of the current row
- Content of a specific row
- Positioning on a specific row
Manipulating Looper controls programmatically
WINDEV, WINDEV Mobile and WEBDEV allow you to manipulate a RepeatString Looper control directly by programming.. To do so, use the variable of the Looper control in the code. The variable of the Looper control corresponds to the name of the Looper control. This variable is an integer. Initializing the different controls/attributes of a Looper control To initialize the different controls/attributes of a Looper control: - use LooperAdd or LooperAddLine.
- handle each control found in the looper:
<Looper name>[<Index>].<Control name>.<Property name> = <Value>
- handle each control found in all the looper rows:
<Looper name>.<Control name>.<Property name> = <Value> If <Property name> corresponds to Value, only the value of the control specified for the current row is modified.
- handle each attribute of the Looper control:
<Attribute name>[<Index>] = <Value> - handle each attribute of the Looper control for the current row:
<Attribute name> = <Value>
For example: - Change the value of the "EDT_CustomerName" edit control in the "LOOP_Customer" looper control for row #8:
LOOP_Customer[8].EDT_CustomerName.Value = "Montgomery"
- Change the value of the "EDT_CustomerName" edit control in the "LOOP_Customer" looper control for the current row:
LOOP_Customer.EDT_CustomerName.Value = "Montgomery"
- Change the background color of the "EDT_CustomerName" edit control in the "LOOP_Customer" looper control for row #8:
ZR_Client[8].SAI_ClientName.BackgroundColor = DarkBlue
- Make the "EDT_CustomerPhone" control invisible in the "LOOP_Customer" looper control for all rows:
LOOP_Customer.EDT_CustomerPhone.Visible = False // In WEBDEV, an attribute used to modify the visibility // of "EDT_CustomerPhone" must exist
- Modify the width of the "EDT_CustomerAddress" control linked to the "ATT_WidthAttribute" attribute in the "LOOP_Customer" looper control for row #8:
ATT_WidthAttribute[8] += 100
- Modify the width of the "EDT_CustomerAddress" control linked to the "ATT_WidthAttribute" attribute in the "LOOP_Customer" looper control for the current row:
ATT_WidthAttribute += 100
Remark: These lines of code must be present in the "Line display" event of the RepeatString Looper control. Retrieving the value of the different controls/attributes found in a Looper control To retrieve the value of the different controls/attributes found in a Looper control: - handle each control found in the Looper control:
<Value> = <Looper name>[<Index>].<Control name>.<Property name>
- handle each control found in the looper for the current row:
<Value> = <Looper name>.<Control name>.<Property name>
- handle each attribute of the Looper control:
<Value> = <Attribute name>[<Index>] - handle each attribute of the Looper control for the current row:
<Value> = <Attribute name>
For example: - Find out the value of the "EDT_CustomerName" edit control in the "LOOP_Customer" looper control for row #8:
ResCustomerName = LOOP_Customer[8].EDT_CustomerName.Value
- Find out the value of the "EDT_CustomerName" edit control in the "LOOP_Customer" looper control for the current row:
ResCustomerName = LOOP_Customer.EDT_CustomerName.Value
- Find out the background color of the "EDT_CustomerName" control in the "LOOP_Customer" looper control for row #8:
ResColor = ZR_Customer[8].SAI_CustomerName.BackgroundColor
- Find out the width of the "EDT_CustomerAddress" control linked to the "ATT_WidthAttribute" attribute in the "LOOP_Customer" looper control for row #8:
ResWidth = ATT_WidthAttribute[8]
- Find out the width of the "EDT_CustomerAddress" control linked to the "ATT_WidthAttribute" attribute in the "LOOP_Customer" looper control for the current row:
ResWidth = ATT_WidthAttribute
Retrieving the value of the different controls/attributes of a row found in a Looper control Content of the current row To retrieve the content of current row: <Value> = <Looper name>[<Looper name>] The result is a character string containing:   each attribute and/or each control separated by TAB.
Content of a specific row To retrieve the contents of the row whose index is <Index>: <Value> = <Looper name>[<Index>] The result is a character string containing:  each attribute and/or each control separated by TAB.
Positioning on a specific row To position on a specific row, use the following syntax: For example: // Add an empty row LooperAdd(LOOP_Product) // Position on the empty row LOOP_Product = LooperCount(LOOP_Product)
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|