|
|
|
|
|
- Overview
- How to?
- Including a Table control in a Looper control
- Including a control in a Looper control
- Accessing the contents of internal window fields from the host window
Display different content for each row
In a Looper control, a different content can be assigned to the Table, Chart, List Box and TreeView controls: - If the control to repeat is a Table control or a Chart control, all you have to do is insert it into the Looper control directly.
- If the control to repeat is another type of control (List Box control, TreeView control, etc.), simply insert this control into an internal window. Then, all you have to do is create the associated Internal Window control in the Looper control.
Remark: Table, Chart control or internal window fields must be populated programmatically. Including a Table control in a Looper control To include a Table control in a Looper control: - If necessary, create a RepeatString Looper control: RepeatString file, by programming or variable.
- Insert the Table control into the Looper control. The Table control must be populated programmatically.
- Make sure that "Identical content for all the rows" is unchecked ("UI" tab in the description window of the Table control).
- The Table control can now be populated programmatically.
The Table control found in the Looper control can be filled by using TableAddLine according to the following method: TableAddLine(<Name of Looper control>[Row index].<Name of Table control>, <Element Column 1>, <Element Column 2>, ...) Example The following code fills the Table control in the RepeatString field. The Looper control lists the orders and the Table control lists the products ordered. The following code is used to populate both the Looper control and the Table control: PROCEDURE FillOrdersOfTheDay()
nIndex is int
LooperDeleteAll(LOOP_OrdersOfTheDay)
FOR EACH Order WITH "OrderDate = '"+Today() + "' AND IsFinalized = 0"
HReadSeekFirst(CustomerContact, CustomerContactID, Order.CustomerContactID)
IF HFound(CustomerContact) = False THEN CONTINUE
nIndex = LooperAddLine(LOOP_OrdersOfTheDay, Order.OrderID, ...
CustomerContact.Company, CustomerContact.LastName + ...
[" "] + CustomerContact.FirstName)
FOR EACH OrdLine WITH OrderID = Order.OrderID
HReadSeekFirst(Product, ProductID, OrdLine.ProductID)
IF HFound(Product) = False THEN CONTINUE
TableAddLine(LOOP_OrdersOfTheDay[nIndex].TABLE_Order, ...
Product.ProductID, Product.Caption, OrdLine.Quantity)
END
END
For a simpler syntax, it is possible to fill a line in the RepeatString Looper control directly in the display code.. In this case, there is no need to specify the index of the main looper. The syntax becomes: TableAddLine(<Name of Table control>, <Element column 1>, <Element column 2>, ...) Tip In the display code for a line in the RepeatString field, remember to empty the Table control before filling it with the TableDeleteAll function. Including a control in a Looper control To integrate another control (List Box, TreeView, etc.) into the Looper control: - If necessary, create a RepeatString Looper control: RepeatString file, by programming or variable.
- Insert an Internal Window control into the Looper control.
- Make sure that "Identical content for all the rows" is unchecked ("UI" tab in the description of the Internal Window control).
- Create an internal window if necessary. Insert the control (Chart, List Box, TreeView, etc.) into this internal window. The inserted control must be populated programmatically.
- Associate the Internal Window control with the internal window ("General" tab in the description of Internal Window control).
- The control can now be populated programmatically.
For example, TreeAdd can be used as follows in order to fill a TreeView control found in a Looper control: TreeAdd(<Name of Looper control>[Row index]. <Name of Internal Window>.<Name of TreeView Control>, <Element to Add>) Accessing the contents of internal window fields from the host window To access the contents of the internal window's fields from the host window, simply manipulate the desired row, the internal window and then the field.. Example: Retrieve the value of a date-type Edit control from the first occurrence of the RepeatString Looper control: x is Field <- ZR_SansNom1[1] Trace(x.FI_SansNom1.SAI_DATE)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|