Dynamic Layout object

Introduction

In Web & SD development some visual patterns are frequent. These patterns can be defined in Dynamic Layouts, which are objects in a GeneXus KB that encapsulate the definition of the pattern.

These objects are created using a special type that depends on the platform (Web/SD) and contain all possible options available in that platform: If a Web Dynamic Layout is created, the developer may use everything that can be used in a Web Panel.

A layout’s definition consists of two parts: a metadata part that defines the components that will be present in the layout, and Layout/WebForm parts that define the visual design where those components are used. Optionally, Events and Variables parts may be used to implement advanced features.

SDDynamicLayoutMetadata
SD Dynamic Layout Metadata

The nodes used in the object's definition are documented in Dynamic Layout metadata nodes.

WebDynamicLayoutMetadata
Web Dynamic Layout Metadata

Usage

These objects can be used when creating Web Panels using Web Panel Designer or SD Panels using K2BSDDesigner. In particular, they can be selected when executing actions such as 'Add Grid From Transaction'.

When a dynamic layout is used to create an object, the developer must specify the actual contents that should be placed in each of the components declared in the metadata part.

DynamicLayoutMappingExample
Mapping example

In this case, the attribute CustomerName is used as a Title, CustomerPhoto is used as a Photo, and CustomerId is used as a Key. The Main Action is set to “Call”, and “Update” and “Delete” actions are included in the Actions section. Four attributes are included in the Attributes section.

After this mapping is completed, the Form for the panel will be created. When creating the “GridCustomer” grid, the Dynamic Layout’s Form definition will be used, replacing each component with its final values.

Creation

K2BTools provides a set of standard layouts that will be updated to match changes in themes provided with K2BTools, such as K2BFlat.

The developer may choose to create new Dynamic Layouts to suit specific needs, see Creating Dynamic Layouts.