Show TOC

Background documentationMatrixLayout Locate this document in the navigation structure

 

The MatrixLayout arranges the UI elements as a table in a grid structure. It uses predefined cell classes that guarantee appropriate margins between cells in the grid. The vGutter property lets you specify additional horizontal margins. You can set these additional distances (known as gutters) with or without separators. In addition, the MatrixLayout can include horizontal separators to separate the rows further, represented by the HorizontalGutter UI element. This type of layout is preferable to the GridLayout, since it makes the layout structure in a container more consistent. Using the interface MatrixHeadData, you can specify the UI element that appears at the start of each new line.

Note Note

You should avoid using nested MatrixLayouts. Instead, use RowLayouts wherever possible. The RowLayout differs from the MatrixLayout in that the content is not organized in table cells – that is, the individual elements are not aligned vertically with each other. Whenever RowLayouts are implemented in an application, performance is better than if a MatrixLayout were used, and the layout flexibility is not compromised. For this reason, you should structure the view and container in horizontal areas as early as possible, using the RowLayouts. You should only use the MatrixLayout if you need to display a table and align the elements vertically.

End of the note.

More information: Layout Optimization for FlowLayout and MatrixLayout

Implementation Details

Runtime Class

CL_WD_MATRIX_LAYOUT

Properties in View Designer

Name

Type

Initial Value

Bindable

ID

STRING

(automatic)

No

stretchedHorizontally

WDY_BOOLEAN

false

No

stretchedVertically

WDY_BOOLEAN

false

No

Aggregations in View Designer

Name

Cardinality

Type

DRAG_SOURCE_INFO

0..1

DragSourceInfo

DROP_TARGET_INFO

0..1

DropTargetInfo

Events in View Designer

Name

onDrop

Note Note

Layout data is not bindable.

End of the note.

Other properties that can be inherited are defined in the related higher-level classes. The related UI elements are:

Dynamic Programming

For dynamic programming, the same properties, events and aggregations are available as in the View Designer. But note that the spelling format and use of upper/lower case is different.

Dynamic Programming of Properties

View Designer Name

Runtime Name

Type

stretchedHorizontally

STRETCHED_HORIZONTALLY

WDY_BOOLEAN

stretchedVertically

STRETCHED_VERTICALLY

WDY_BOOLEAN

Caution Caution

Note that with dynamic programming the default values of stretchedHorizontally and stretchedVertically are set to true, whereas in the view designer they are set to false.

End of the caution.
Dynamic Programming of Events

View Designer Name

Runtime Name

onDrop

ON_DROP

Dynamic Programming of Aggregations

View Designer Name

Runtime Name

Cardinality

DRAG_SOURCE_INFO

DRAG_SOURCE_INFO

0..1

DROP_TARGET_INFO

DROP_TARGET_INFO

0..1