Dynamic lists and columns

With the upcoming conzept 16 version 5.7.05, you will be able to dynamically create list and column objects—that is, at runtime.

This allows you to build variable list objects using procedures as needed, eliminating the need to prepare them with hidden columns.

Read this article to learn how this works and what you need to keep in mind.

The dynamic creation of UI objects is performed using the function WinCreate(), which has been part of the feature set since version 5.7.01, as has the function WinAdd(), which is called to add one object to another.

The list items—which can be created dynamically—are

    • DataList (_WinTypeDataList),
    • DataListPopup (_WinTypeDataListPopup),
    • RecList (_WinTypeRecList),
    • RecListPopup (_WinTypeRecListPopup),
  • StoList (_WinTypeStoList),
  • StoListPopup (_WinTypeStoListPopup) and
  • RecView (_WinTypeRecView)

as well as the column objects

  • Column (_WinTypeListColumn, for Data, Rec, and StoList objects) and
  • GroupColumn (_WinTypeGroupColumn, for RecView objects).
Example
// Create a DataList object named “dlsMyDataList”
tWinDataList # WinCreate(_WinTypeDataList, 'dlsMyDataList');
// Set position (x: 8, y: 8) and dimensions (120 x 80, W x H):
tWinDataList->wpArea # RectMake(8, 8, 128, 88);
// Add a DataList object to a Frame object
aWinFrame->WinAdd(tWinDataList);

You have now created a DataList object and added it to a Frame object, though it does not yet have any columns. These are created in the same way.

Example
// Create a column named “clmMyColumn” with the label “No.”
tWinColumn # WinCreate(_WinTypeListColumn, 'clmMyColumn', 'Nr.');
// Add a column to the list
tWinDataList->WinAdd(tWinColumn);

This creates a Column object—that is, a column—and adds it to the DataList object—the list. The list object itself can also be a static one, which you can expand with additional columns in this way. Dynamically created Column objects have, among other things, the following properties:

  • wpVisible = true,
  • wpClmType = _TypeAlpha,
  • wpDbFieldName = '',
  • wpClmWidth = 70 und
  • wpClmOrder = _MaxInt.

You can customize the properties as desired after they have been created. The wpClmType property is relevant only for DataList and DataListPopup objects, while the wpDbFieldName property is relevant only for RecList and RecListPopup objects.

Note: Starting with this version, the wpClmType property can also be modified for static columns, provided the DataList object does not contain any rows.

The wpClmOrder property determines the display position of the column. Columns with a small value are positioned on the left, while columns with a large value are positioned on the right. At the maximum value (_MaxInt), they are therefore always positioned on the far right. After positioning, the value of the property is set to the actual display position.

Example
// Show the column in the third position
tWinColumn->wpClmOrder # 3;
// Add a column to the list
tWinDataList->WinAdd(tWinColumn);

The index position of the column—which, for example, must be specified in the WinLstCellSet() function—is determined by the insertion order, which can be controlled using the WinAdd() function. Specifically, a subsequent column can be specified, in front of which the column to be inserted is placed. If no subsequent column is specified, the column is inserted after the last existing column.

You can only add or remove a column before the last position as long as the list is empty—that is, as long as a DataList object contains no rows or a RecList object has no table or key assigned to it. You can add or remove a column at the last position at any time.

Example
// Determine the first column
tWinColumnRef # tWinDataList->WinInfo(_WinFirst);
// Determine the third column
tWinColumnRef # tWinColumnRef->WinInfo(_WinNext, 2);
// Insert a column at the third position (index = 3)
tWinDataList->WinAdd(tWinColumn, 0, tWinColumnRef);
...
// Add row
tLine # tWinDataList->WinLstDatLineAdd(...);
// Set third cell
tWinDataList->WinLstCellSet(..., 3, tLine);

Dynamic generation offers you many new, flexible, and resource-efficient ways to customize lists to suit your specific needs.

We look forward to seeing how you put this into practice =).

Klicken Sie hier, um die Nutzungsbedingungen für unseren Blog zu lesen.

Leave a Reply

Your email address will not be published. Required fields are marked *

Leave the field below empty!

Requests, questions or feedback are welcome:

Terms of use of the comment function in the blog

1. General information

Vectorsoft AG (‘Provider’) provides a public blog for Internet users (‘Users’) on the vectorsoft.de website. The public blog is intended for the exchange of information and ideas. Users who participate with contributions and comments undertake to comply with the blog terms of use and are responsible for the accuracy, appropriateness and freedom from legal infringements of their contributions. By using the comment function in our blog, you accept these terms of use.

2. Netiquette

We ask you to refrain from personal attacks and provocations based on other opinions. Please argue objectively and maintain a constructive discussion culture. Your comment should always be related to the topic in question in order to avoid digressions into other topics. Posting the same comment or several similar comments more than once is not permitted.

3. Prohibition of illegal content

By submitting your comment, you confirm that you are not violating any copyrights or other rights of third parties. Inciting, racist statements, instructions for criminal offences and their glorification, depictions of violence, pornographic content and statements that violate personal rights are prohibited.

4. No advertising

The use of the comment function is not permitted for commercial or party-political purposes. Advertising contributions of any kind will be deleted immediately.

5. Details of the name

When entering your name, pay attention to the principles mentioned above.

6. Source references

If you intend to publish quotes or contributions from third parties, please indicate the respective sources and explain how they relate to the blog post.

7. Violation of the terms of use

Posts that violate this policy will be deleted immediately. If you notice any violations yourself, please send us the link to the comment in question by e-mail to . We expressly point out that we will exclude individual users in the event of repeated or serious violations of these terms of use.

As of: Sept. 2024

Get your Trial Version now!

Test yeet free of charge

IHRE EVALUIERUNGSLIZENZ - JETZT ANFORDERN!

TESTEN SIE DIE CONZEPT 16 VOLLVERSION - UNVERBINDLICH und KOSTENFREI

Subscribe to our newsletter

Anrede*
     
Zustimmung zur Datenverarbeitung gem. DSGVO*



WordPress Cookie Notice by Real Cookie Banner