SAPUI5 and Fiori Tools Part 3: Data Binding — JSON Model, OData Model, Modes
Preview · a free account unlocks the full lesson
Binding connects UI controls to model data declaratively, using paths such as {/path}, {model /path} or {relativePath}. A JSONModel suits UI state, an OData V4 model suits backend data, and a ResourceModel handles translated texts via i18n. Binding modes include one-way, two-way (the default for V4 inputs), and one-time.
In this lessonShow sectionsHide sections
Visual overview
Explanation
Binding connects UI controls to model data declaratively, using paths such as {/path}, {model>/path} or {relativePath}. A JSONModel suits UI state, an OData V4 model suits backend data, and a ResourceModel handles translated texts via i18n. Binding modes include one-way, two-way (the default for V4 inputs), and one-time. Display logic belongs in formatters and expression binding, not in controller code.
Binding matters because, instead of reading a value, finding a control, setting the value, and repeating that cycle after every change, you simply declare the relationship once and let the framework keep it in sync.
A JSON model is used for client-side state or small local datasets. For example, a model might be created with new JSONModel({ customer: { name: "ABC Industries", status: "Active" } }) and set on the view with this.getView().setModel(oModel); the view then references it directly with something like <Text text="{/customer/name}" />.
Named models are used when different kinds of data need to coexist — a default OData model, a "view" model for UI state, and an "i18n" resource model, for instance. A control referencing the named "view" model might look like <ObjectStatus text="{view>/statusText}" />.
Create a free account to keep reading
You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.
- Full explanation
- Code example
- Real project scenario
- Common mistakes
- Best practices
- Interview angle
One tap with Google works too. Every topic keeps its first lesson open to everyone.
Keep exploring
Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.