skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
ui5/plugins-coding-agents124 installs

ui5-best-practices-mdc

UI5 MDC (sap.ui.mdc) best practices for OData V4 delegate-based controls. Use when creating/troubleshooting MDC FilterBar, Chart, Field, FilterField, ValueHelp, Link, MultiValueField, or Table. Covers delegate pattern, fetchProperties, PropertyInfo, p13nMode, updateBindingInfo, Condition.createCondition, and common errors (delegate not loaded, chart no data, fields not appearing). Also applies to JSON model (non-OData) MDC usage. Triggers: "MDC", "sap.ui.mdc", "delegate pattern", "fetchProperties", "PropertyInfo", "MDC personalization", "p13nMode", "MDC field not rendering", "MDC chart not binding", "MDC conditions", OData V4 freestyle with model-driven controls. Keywords: sap.ui.mdc, FilterBar, Chart, Field, FilterField, ValueHelp, Link, MultiValueField, delegate, fetchProperties, updateBindingInfo, PropertyInfo, OData V4, JSON model, TypeMap, p13nMode, conditions, FilterBarDelegate, ChartDelegate, ValueHelpDelegate, LinkDelegate, Condition.createCondition

How do I install this agent skill?

npx skills add https://github.com/ui5/plugins-coding-agents --skill ui5-best-practices-mdc
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    The skill provides comprehensive best practices, architectural patterns, and technical reference material for developing applications with SAPUI5 Model-Driven Controls (MDC). No security issues or malicious patterns were detected.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

What does this agent skill do?

UI5 MDC Controls Best Practices

Apply these guidelines whenever generating, reviewing, or troubleshooting MDC control code in freestyle applications using OData V4 services.

UI5 version baseline: SAPUI5 1.136+ LTS. All features mentioned are available from this version unless noted.

When to load each reference

TriggerLoad
Working on or planning a sap.ui.mdc.FilterBarreferences/mdc-filter-bar.md
Working on or planning a sap.ui.mdc.Chartreferences/mdc-chart.md
Working on or planning a sap.ui.mdc.Fieldreferences/mdc-field.md
Working on or planning a sap.ui.mdc.FilterFieldreferences/mdc-filter-field.md
Working on or planning a sap.ui.mdc.ValueHelpreferences/mdc-value-help.md
Working on or planning a sap.ui.mdc.Linkreferences/mdc-link.md
Working on or planning a sap.ui.mdc.MultiValueFieldreferences/mdc-multi-value-field.md
Using MDC controls with JSON model (non-OData)references/mdc-json-delegates.md

Load before producing any output. Do not work from memory.


The Delegate Pattern

All MDC controls use a delegate to decouple the control from data-source-specific logic. App developers must:

  1. Specify the delegate in XML: delegate="{name: 'my/app/delegate/MyDelegate', payload: {entitySet: 'Products'}}"
  2. Implement the delegate module extending the appropriate base delegate
  3. Override key methods (at minimum fetchProperties)

Base delegates for OData V4:

ControlBase Delegate
Tablesap/ui/mdc/odata/v4/TableDelegate
FilterBarsap/ui/mdc/odata/v4/FilterBarDelegate
Chartsap/ui/mdc/odata/v4/vizChart/Delegate
ValueHelpsap/ui/mdc/ValueHelpDelegate
Linksap/ui/mdc/LinkDelegate
MultiValueFieldsap/ui/mdc/field/MultiValueFieldDelegate

JSON model usage: MDC controls also work with JSON models. Extend the base delegates directly (sap/ui/mdc/TableDelegate, sap/ui/mdc/FilterBarDelegate) — not the OData V4 variants. See references/mdc-json-delegates.md for details.

PropertyInfo — the core metadata format returned by fetchProperties:

{
    key: "propertyName",        // Unique identifier (required)
    label: "Display Label",     // User-visible label (required)
    dataType: "sap.ui.model.odata.v4.type.String"  // Data type (required)
}

Core Rules

Mandatory

  • Every MDC control requires a delegate property pointing to a valid module path.
  • Implement fetchProperties in the delegate returning PropertyInfo[] with at minimum: key, label, dataType.
  • Extend the appropriate OData V4 base delegate (see table above) for OData V4 services. For JSON/other models, extend the generic base delegate directly.
  • Use p13nMode to enable personalization (Column, Sort, Filter, Group for Table; Item, Sort, Filter, Type for Chart; Item for FilterBar).
  • Use sap.ui.mdc.condition.Condition.createCondition() to construct conditions programmatically.
  • Use sap.ui.model.odata.v4.type.* types in PropertyInfo dataType field for OData V4 models. Use sap.ui.model.type.* with JSON models. Register types in the TypeMap.
  • Set ariaLabelledBy on FilterBar and Chart for accessibility.
  • Prefer Fiori elements building blocks over freestyle MDC. Use MDC only when Fiori elements is out of scope.
  • Use get_api_reference MCP tool to verify control APIs. Use run_ui5_linter to validate code.

Prohibitions

  • Do not use MDC controls with OData V2 models. Use Smart controls (sap.ui.comp) instead. MDC works with OData V4 and JSON models.
  • Do not access inner controls directly (e.g., inner sap.chart.Chart or sap.m.Table). Use the delegate or MDC control's public API.
  • Do not omit key from PropertyInfo objects (formerly name, now deprecated).
  • Do not construct condition objects manually as plain JSON. Always use Condition.createCondition(operator, values).
  • Do not skip delegate implementation for production code (built-in defaults are for demos only).
  • Do not use inline styles or scripts (CSP compliance).
  • Do not use global access (sap.ui.mdc.FilterBar). Use sap.ui.define or ES6 imports.

Selection Matrix

ControlUse whenDo not use when
MDC FilterBarOData V4 or JSON model, delegate-driven filter UI, MDC Table/ChartOData V2 (use SmartFilterBar), simple search bar
MDC ChartOData V4, delegate-driven chart visualization, drill-downOData V2 (use SmartChart), simple static charts, no analytical data
MDC FieldOData V4 or JSON, single field with auto-rendering by data typeOData V2 (use SmartField), purely custom rendering needed
MDC FilterFieldInside MDC FilterBar for individual filter conditionsStandalone filtering outside FilterBar context
MDC ValueHelpOData V4 or JSON, type-ahead + dialog value selectionOData V2 (use ValueHelpDialog), simple dropdowns without search
MDC LinkOData V4, semantic object navigation, delegate-driven link targetsOData V2 (use SmartLink), simple static links
MDC MultiValueFieldOData V4 or JSON, multi-value token entry via items aggregationOData V2 (use SmartMultiInput), simple single-value fields

Common Errors

SymptomCauseFix
"Delegate module could not be loaded"Wrong path in delegate propertyVerify module path matches actual file location in project.
Chart shows no datafetchProperties returns wrong PropertyInfo (missing groupable/aggregatable)Ensure dimensions have groupable: true, measures have aggregatable: true.
FilterBar fields not appearingPropertyInfo missing or hiddenFilter: trueCheck delegate fetchProperties returns properties with correct visibility.
Field shows wrong inner controldataType in PropertyInfo doesn't match expected formatVerify dataType uses full qualified type name (e.g., sap.ui.model.odata.v4.type.String).
Personalization dialog emptyp13nMode not set or PropertyInfo incompleteAdd p13nMode="Column,Sort,Filter" and ensure PropertyInfo has sortable/filterable flags.
ValueHelp not openingValueHelp not connected to Field or containers missingVerify valueHelp association on Field and that Popover/Dialog containers are defined.
Conditions not applied to bindingupdateBindingInfo not implemented in delegateImplement updateBindingInfo to apply filter conditions to the OData binding.
Link always rendered as textfetchLinkType returns LinkType.Text or failsImplement fetchLinkType returning Popup or DirectLink type.

Performance & Accessibility

Anti-patterns to avoid

  • Loading all PropertyInfo eagerly when only a subset is needed (return minimal set from fetchProperties).
  • Not implementing updateBindingInfo (conditions are never applied to the data binding).
  • Skipping p13nMode configuration (personalization features are disabled by default).
  • Creating large delegate modules (split complex logic into helper modules loaded on demand).
  • Using synchronous operations in delegate methods (all delegate methods should return Promises).

Accessibility checklist

  • Set ariaLabelledBy on FilterBar referencing a visible title.
  • Set ariaLabelledBy on Chart referencing a visible title.
  • Verify keyboard navigation works for personalization dialogs.
  • Test ValueHelp type-ahead and dialog with screen reader.
  • Ensure all FilterFields have meaningful labels via PropertyInfo label.

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/ui5/plugins-coding-agents/ui5-best-practices-mdc">View ui5-best-practices-mdc on skillZs</a>