Skip to content

How to show fields from a referenced model

If you want to show in a Grid or in a Form a field from a referenced model, you have to customize the MainTable/Fields node of the view, by using the model.field notation and adding a local name to the field.

Example from [HelloKitto] (HelloKitto):

yaml
# model girl.yaml
ModelName: Girl
....
Fields:
......
  Phone: String(16)
    Rules:
      SubType: phone_number
yaml
# view dolls.yaml
Type: Data
Controller: List
.....
MainTable:
  Model: Doll
  Fields:
.....
    Mom:
    Mom.Phone: Mom_Phone
      DisplayLabel: _(Mom's Phone)

ReferencedFieldsGrid.pngReferencedFieldsForm.png

Released under Apache License, Version 2.0.