To continue with this content, please log in with your Data Access ID or create a new account.
Cancel Data Access ID
You may not be authorized to see this content. Please contact Data Access Europe for more information.
Cancel Data Access Europe
You are not authorized to see this content.
Cancel Data Access Europe
Next lesson:
Panel layout
Cancel

The CSS and HTML Secrets of DataFlex WebApps

Lesson 6 - Column layout

A summary of the video course

In this lesson, we will delve deeper into the Column Layout System, which is the standard layout system in the DataFlex Web Framework. This system employs a flow-based layout mechanism where controls are positioned within specific columns. Controls can span multiple columns, and the number of columns is adjustable. The layout flows automatically from left to right and top to bottom.

Creating a New View 

To explore the Column Layout System, start by adding a new view to your DataFlex workspace. You can use the "web view" template and select "Column Layout."

Reviewing the Default Form and Panel 

We open the WebApp Designer. Upon creating the view, you will notice that a form has already been generated. This form is contained within a panel. While this panel is optional, it is included to make it easier to add extra panels if needed.

Understanding Column Configuration 

To configure columns, select the panel.  You will see a bar at the top of the panel that represents the columns. In this case, there are 12 columns numbered from 0 to 11. You can adjust the number of columns using the plus and minus signs.

Positioning Controls 

The main feature of the Column Layout System is the ability to position controls within the columns. To do this, drag and drop controls from the class palette onto the panel. As you move controls, you will see an indicator showing where they will be placed in relation to existing controls.

Configuring Control Spans and Positions

By default, controls have a column span of 0 (spanning all available columns to the right) and a column index of 0 (starting from the first column). You can adjust these settings to control how controls are positioned within the columns. Dragging controls horizontally changes their column index, and adjusting their width changes their column span.

Using Spacers for White Space

To create white space or push controls to the next line, you can use spacers. Spacers are invisible controls that affect layout. Drag a spacer from the class palette onto your view, and you can position it relative to other controls. It will push controls down or create space between them.

Working with Controls with Variable Heights

Some controls, like lists, have variable heights. You can set their height by using piHeight or use the "pbFillHeight" property to make them expand to fill available space. You can also set a minimum height to prevent controls from becoming too small (piMinHeight).

Using Groups

Groups (Web Containers cWebGroup) can be used to group controls together for layout purposes. They can be made invisible by setting "pbShowBorder" and "pbShowCaption" to false. Groups are useful for managing the layout of multiple controls together, especially when you want to align controls horizontally.

Compiling and Running Your Application

After configuring your column layout, compile your project and run it. You will see the controls positioned as per your settings. Remember that the Column Layout System uses CSS for rendering, and it sets various CSS properties such as float, clear, margin, width, and height based on your column configurations.

The Column Layout System in DataFlex offers a flexible way to arrange controls in your web applications. Understanding how to use columns, adjust spans and positions, work with spacers, and utilize groups will help you create well-structured and visually appealing layouts. In the next lesson, we will explore the Panel Layout System.