eva/3 Application BuilderDeveloping eva/3 ApplicationsWorking with FormsTable BeansTSubForm 

Sub Form Example

The TSubForm table component allows to show or hide a sub form for a data record row. A new sub form instance will be created for each row so the different sub forms can be edited independently. The data record placement in the sub form gets not lost after a row change or after hiding and displaying them.

Fig. 205: TSubForm Example
Fig. 205: TSubForm Example

TSubForm table component setup

The example (s. Fig. 142) shows a SScrollTable, which has a TSubFrom component configured which displays a sub form. The TSubForm component can be configured by editing the TableColumnDefinition property within the SScrollTable. Just select or add a new column in the TableColumnDefinition editor and click at it. Than select TSubForm component from the Editor field. Afterwards just click at the Editor properties button for opening the TSubForm properties dialog for editing.

Property setup

The register Database contains all properties needed for the sub form setup.

The SubForm property allows to specify which form should be loaded as a sub form instance into the SScrollTable. The property SubFormRowHeight allows to specify the height of the sub form row in the SScrollTable.

For displaying the correct data record for the table row, filters can be specifies using the properties LinkChildFields and LinkMasterColumns. The property LinkMasterColumns specifies the columns of the table which contains the data to be filtered in the sub form. The property LinkChildFields specifies the component/s containing the value to be filtered for.

The example (s. Fig. 142) uses the column ID as LinkMasterColumns and the component txt_id within the sub form as LinkChildFields. The sub form display only that records which matches to the value within the ID column.

Attention

While using sub forms pleas keep in mind that the component names should be unambiguously. If an STableElement in the sub form has the same name as a STableElement in the main form, the filter setup could fail beacuse the setup is possibly performed at the wrong component.