N NezamDocumentation

Controls grammar#

Controls grammar describes reusable UI controls and control properties that forms and app pages can compose.

Source#

PropertyValue
Grammar filepackages/business/language/grammar/controls.g4
Grammar namecontrols
Grammar kindparser
Importscommon, expression, literal
Imported byBusinessLanguage, module
Direct rule or token count8

How to use this page#

Read the examples first when authoring Business Language. Use the rule inventory when checking exact grammar coverage or when updating parser, lowering, editor, or documentation behavior.

Entry rules and syntax families#

Start with these rules when reading this grammar: controlDeclaration.

  • Declarations: controlDeclaration

Key grammar excerpts#

controlDeclaration#

antlr
controlDeclaration: annotation* accessModifier? CONTROL identifier controlHeader? OPEN_BRACE controlMember* CLOSE_BRACE;

Complete rule and token inventory#

text
controlChildren, controlDeclaration, controlEvent, controlHeader, controlHeaderProperty, controlMember, controlProperty, controlPropertyKey

Examples#

Reusable control#

bl
control MoneyInput {
  label: "Amount";
  bind: invoice.amount;
}

Control property block#

bl
control VendorPicker {
  source: Vendor;
  display: Vendor.vendor_name;
}

Events and nested controls#

bl
control VendorSummary {
  label: "Vendor";

  on change {
    refresh_vendor_summary();
  }

  children: {
    control VendorName {
      bind: vendor.name;
    }
  }
}

Common authoring mistakes#

  • Do not copy examples without checking the rule inventory for the exact grammar boundary.
  • Do not add behavior that depends on missing configuration or undeclared user-facing errors.
  • /language/apps-forms-controls/
  • /language/source-ui-layouts/

Authoring notes#

  • Keep examples aligned with the grammar source, not with inferred syntax from another language.
  • Use declared messages for user-facing failures, and fail closed when required configuration is absent.
Source: packages/business/language/grammar-files/controls.md