Which binding types and binding modes exist in SAPUI5? Which have you used, and where would you set a model to one-way instead of two-way?
Say your answer out loud first.
Practise another way
There are three binding types. Property binding is for one control property. Element or context binding sets a binding context, for example the selected order on a detail page. Aggregation binding, list or tree, creates rows from a template.
The modes are one-time, one-way and two-way. The OData V2 model defaults to one-way, V4 and JSON to two-way. I set the default with defaultBindingMode in the model settings of manifest.json, or per binding with mode.
Binding types
SAP's documentation names them by what they bind:
- Property binding: one control property to one model property, for example
text="{CustomerName}". Types and formatters convert values. - Context (element) binding: binds a control to one object and creates a binding context, so child controls use relative paths. This is the list-detail pattern: the detail view gets
bindElement("/SalesOrder('42')")and its fields bind toGrossAmountwithout a leading slash. - Aggregation binding: creates child controls from a template or factory. List binding for flat collections (table rows), tree binding for hierarchies (for example
sap.ui.table.TreeTable).
A trap here: models have a default size limit of 100 entries for list bindings. Controls without paging, such as sap.m.ComboBox, silently show only 100 items until you call setSizeLimit or set length.
Binding modes
- One-time: value read once, no listeners. Cheapest.
- One-way: model to view only.
- Two-way: changes in the control flow back into the model (property bindings only).
Defaults differ by model: OData V4 two-way, OData V2 one-way, JSON two-way, resource model one-way. Formatter functions switch a binding to one-way; for editable fields use a data type instead.
Where to set it
- Model default in
manifest.json:
"": {
"dataSource": "mainService",
"settings": { "defaultBindingMode": "OneWay" }
}
- In code with
oModel.setDefaultBindingMode(BindingMode.OneWay); this only affects new bindings, not existing ones. - Per binding:
value="{path: 'Note', mode: 'OneTime'}"or{:= ...}for a one-time expression.
When one-way makes sense
Display-only screens, reports, and a V4 app where users should not create pending changes by accident. Two-way fits edit forms. With V2 the changes collect in the deferred group changes until submitChanges.
With V4 they collect in the binding's update group until submitBatch (or are sent at once with the auto group).
In Fiori elements
You do not choose modes; the framework does. The question then is whether a field is editable, which comes from your RAP behaviour definition and field control, not from UI5 code.
Names all three binding types with an example each, gives the per-model defaults correctly and shows both the manifest and per-binding way to change the mode.
Lists 'one-way and two-way' as the binding types, or believes changing the default mode updates existing bindings.
Confusing binding types (property, context, aggregation) with binding modes (one-time, one-way, two-way): interviewers ask for both precisely to see if you know the difference.
- What does the size limit of 100 do, and which controls are affected?
- Why can you not use a formatter with two-way binding?
- How do pending two-way changes reach the back end in V2 and in V4?
2 candidate write-ups and 4 official pages. Confidence: high. Checked 1 Dec 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Candidate write-up Gives the question.
- Candidate write-up Gives the question.