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:
Controls
Cancel

The CSS and HTML Secrets of DataFlex WebApps

Lesson 7 - Panel layout

A summary of the video course

In this lesson, we will explore the Panel Layout System, which provides an alternative to the Column Layout System in DataFlex. Panel layouts can be used independently or in conjunction with column layouts, offering greater flexibility in arranging controls within your web application.

Understanding Panel Hierarchy

In DataFlex, the container (either the main container or a panel) can use either the Panel Layout System or the Column Layout System. You can nest panels within other panels, creating a hierarchy. The primary concept of the Panel Layout System is to have a center panel with optional top, bottom, left, and right panels.

Top Panel Behavior 

The top panel always spans the full width of its parent container. Even if you have left and top panels, the top panel will extend above the left panel. The same applies to the right and bottom panels. If this behavior is not desired, you may need a more complex panel structure.

Creating Resizable Panels

You can create resizable panels that allow end-users to adjust their size by dragging a handle. This provides a flexible way to create rich and interactive layouts.

Adding a Panel Layout to Your Application

Begin by adding a new Web View to your DataFlex application, calling it "PanelLayout." Use a default view template. The view template already includes a web main panel, which serves as the center panel.

Adding Panels to the Layout

To create panels, access the class palette and drag panels onto your view. For instance, you can add a left panel. By default, the panels will span the full height of the view.

Adjusting Panel Heights

To modify the height of panels, you can set specific heights or use a spacer to stretch the panel to full height. A spacer with "pbFillHeight" set to true can make the panel expand to the available space.

Customizing Panel Appearance

You can enhance panel visibility by setting background colors to distinguish them visually within your layout.

You can add controls to the panel, for example a treeview.

Nesting Panels

Nesting panels allows you to create more intricate layouts. You can have multiple panels within other panels, creating a hierarchical structure.

Top and Bottom Panels

Top and Bottom panels size to their content.

Making Panels Resizable

To make a panel resizable, set the "pbResizable" property to true. This will add a resizable handle to the panel's border, allowing users to adjust its size dynamically.

Setting Min and Max Widths (Optional)

You can set "PI min width" and "PI max width" properties to control the minimum and maximum widths a resizable panel can have when users drag the resize handle.

CSS and HTML Structure

Understand that panel layouts in DataFlex are translated into HTML and CSS structures. They consist of a hierarchy of div elements positioned using relative and absolute positioning, and their dimensions are controlled through inline styles.

The DataFlex Panel Layout System provides a powerful way to create complex and responsive web application layouts. By understanding how to configure panels, nest them, make them resizable, and set heights, you can create versatile and visually appealing user interfaces. In the next lesson, we will dive deeper into working with individual controls within these layouts.