Basic Layout object

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.

To customize a layout, we recommend creating a copy of one of the layouts provided by K2BTools and working on the copy. After doing so, the developer can go to the K2BWebPanelDesignerSettings or K2BEntityServices Settings objects and set the new object as the default layout for the entire KB, or set the new layout in specific objects that should be created using it.

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 (Master-Detail) WorkWith (Master-Detail) HTML Editor Layout Object? WorkWith (Master-Detail) Abstract Layout Editor Layout Object?
SubWorkWith (Standard) SubWorkWith (Standard) HTML Editor Layout Object SubWorkWith (Standard) Abstract Layout Editor Layout Object
SubWorkWith (Master-Detail) SubWorkWith (Master-Detail) HTML Editor Layout Object? SubWorkWith (Master-Detail) 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