Inherits from spObject.
component: cBBBlock
class: spBB
The building block is a wrapper for embedding a block component. It has several use like embedding headers and footers (although the template mechanism is preferred), but this component is very helpful to create lookup forms, master-detail forms or in nested grids.


Properties



Description

BuildingBlock

Specifies the pre defined detail building block to be inserted (detail)

DetailDataSource

The datasource to connect to from the master

ExternalDataSource

For future development, do not use.

KeyFields

Key field mapping between master and detail

MasterDataSource

Reference to the master data source


Methods

No exported methods

PHP Events


Event

Trigger

onCreate

Occurs when a component gets created

onActivate

Occurs when a component enters the Activation state

onDestroy

Occurs when a component gets destroyed


JavaScript Events

No additional events

Samples


Use of building-block in a master-detail relationship


To set it a master-detail relationship, you must apply the building block that will be used as the detail. Also you must provide the database connection the detail block needs to use, and setup a valid master-detail key relationship. In sequence:



- define the building block to be used
- define the master datasource
- define the detail datasource
- setup key field mapping
- setup the connection to be used by the detail (the connection used to design the detail is only used to access the database metadata. All connections used must be setup by the main master)

With this information the read-only fields 'detail data source' and 'keyfields' of the master datasouce will be filled automatically.

Use of menu

You can use headers, footers and side menu's. Building blocks are very useful as you only have to specify the menu once. Then, in the layout property you assign the block to the template: