Basic Layout object

Introduction

Basic Layouts are used to define the generic structure of a panel created with K2BTools. A Basic Layout is a Panel where the "Is Layout" property is set to "True".

Types of basic layout

Several types of these layouts exist, to accomodate different generated object types (WorkWith, EntityManager, panels generated using K2BWebPanelDesigner, etc). The "Layout Type" property is used to distinguish among these types.

A particular layout can implement an Abstract Layout Editor (Responsive interface), or an HTML Editor (for Previous Version compatible interfaces). Commonly in a KB both types of layouts exist, so that the developer can choose in each case which kind of layout should be used depending on the Web Form Generator used in each instance.

Using Basic Layout objects

To work with basic layouts some rules must be followed. In simple terms, the layout's form must always contain some components, that are replaced by K2BTools to create the final objects.

The components necessary depend on the interface related to the layout, and the Web Form Generator Used.

Object Type HTML Editor Abstract Layout Editor
WorkWith (Standard) WorkWith (Standard) HTML Editor Layout Object WorkWith (Standard) Abstract Layout Editor Layout Object
WorkWith (TwoPane) WorkWith (TwoPane) HTML Editor Layout Object WorkWith (TwoPane) Abstract Layout Editor Layout Object
SubWorkWith (Standard) SubWorkWith (Standard) HTML Editor Layout Object SubWorkWith (Standard) Abstract Layout Editor Layout Object
SubWorkWith (TwoPane) SubWorkWith (TwoPane) HTML Editor Layout Object SubWorkWith (TwoPane) Abstract Layout Editor Layout Object
EntityManager EntityManager HTML Editor Layout Object EntityManager Abstract Layout Editor Layout Object
General General HTML Editor Layout Object General Abstract Layout Editor Layout Object
WebPanelDesigner K2BWebPanelDesigner HTML Editor Layout Object K2BWebPanelDesigner Abstract Layout Editor Layout Object

Events handling

Code added to the layout object is copied to the generated panel. The developer may use slots to restrict that process based on conditions.

For example, the developer can add slots to copy code only when certain types of filters are present. See more in: Customizing filters UI in Basic Layout objects.

The developer can also add slots to copy blocks of code only when a certain action region is not empty, as shown below.

Event Start

//+ If.DownloadsSectionActions

DownloadActionsTable.Visible = false

//-

EndEvent

Code sample

In this sample, the line in grey will only be included when the DownloadsSection region is not empty.

Possible slots are:

Action Region Slot Name
Bottom If.BottomActions
Top If.TopAction
Top (Right) If.TopRightActions
Top (Left) If.TopLeftActions
In-Grid If.InGridActions
Grid-Associated (Left) If.GridAssociatedLeftActions
Grid-Associated (Right) If.GridAssociatedRightActions
Downloads Section If.DownloadsSectionActions