Skip to content

Commit ff8c57b

Browse files
committed
OpenUI5 Documentation Update 22.02.2024
1 parent f666505 commit ff8c57b

File tree

3 files changed

+39
-39
lines changed

3 files changed

+39
-39
lines changed

docs/Replacement_of_Bindings_604b1eb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ At the time the binding is resolved, `field>Value` refers to `meta>/dataServices
3030

3131
<Label text="Phone"/>
3232
<Text text="{path : 'PhoneNumber', type : 'sap.ui.model.odata.type.String', constraints : {'maxLength':'30'}}" />
33-
Custom Formatter Functions
33+
3434
```
3535

3636
***

docs/Step_2_Creating_a_Model_5278bfd.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -51,48 +51,48 @@ In this tutorial, we will focus on JSON models since they are the simplest ones
5151

5252
You can view and download all files in the Demo Kit at [Data Binding - Step 2](https://sdk.openui5.org/entity/sap.ui.core.tutorial.databinding/sample/sap.ui.core.tutorial.databinding.02).
5353

54-
***
55-
56-
### webapp/index.js
57-
58-
```js
59-
sap.ui.require([
60-
"sap/m/Text",
61-
"sap/ui/model/json/JSONModel"
62-
], function (Text, JSONModel) {
63-
"use strict";
64-
65-
// Attach an anonymous function to the SAPUI5 'init' event
66-
sap.ui.getCore().attachInit(function () {
67-
// Create a JSON model from an object literal
68-
var oModel = new JSONModel({
69-
greetingText: "Hi, my name is Harry Hawk"
70-
});
71-
72-
// Assign the model object to the SAPUI5 core
73-
sap.ui.getCore().setModel(oModel);
74-
75-
76-
// Create a text UI element that displays a hardcoded text string
77-
new Text({text: "Hi, my name is Harry Hawk"}).placeAt("content");
78-
});
79-
});
54+
1. Create a new folder named `model` in the `webapp` folder. In this folder, create a file called `data.json` with the following content:
55+
56+
**webapp/model/data.json**
57+
58+
```
59+
{
60+
"greetingText" : "Hi, my name is Harry Hawk"
61+
}
62+
```
63+
64+
2. Create a new JSON model in the `manifest.json` and set its path via a URI. This binds the model object to the app component and makes it globally available to all controls used within the application.
65+
66+
**manifest.json**
67+
68+
```
69+
...
70+
"sap.ui5": {
71+
"dependencies": {
72+
"minUI5Version": "1.120.0",
73+
"libs": {
74+
"sap.m": {},
75+
"sap.ui.core": {},
76+
"sap.ui.layout": {}
77+
}
78+
},
79+
"models": {
80+
"": {
81+
"type": "sap.ui.model.json.JSONModel",
82+
"uri": "./model/data.json"
83+
}
84+
},
85+
...
86+
```
87+
88+
89+
Generally speaking, a model object holding business data should be bound to the app's `Component.js` or to the view that displays the data. For an example, see the Walkthrough tutorial, [Step 7: JSON Model](Step_7_JSON_Model_70ef981.md) \(binding to the View\) or [Step 9: Component Configuration](Step_9_Component_Configuration_4cfa608.md) \(binding to the Component\).
8090
81-
```
82-
83-
Create a new JSON model passing the data as object literal and store the resulting model instance in a local variable called `oModel`.
84-
85-
Set `oModel` to be the default model within the entire OpenUI5 core.
86-
87-
This makes the model object globally available to all controls used within the application.
88-
89-
In this case we have bound the model object to the OpenUI5 core. This has been done for simplicity, but is not considered good practice. Generally speaking, a model object holding business data should be bound to the app's `Component.js` or to the view that displays the data. For an example, see the Walkthrough tutorial, [Step 7: JSON Model](Step_7_JSON_Model_70ef981.md) \(binding to the View\) or [Step 9: Component Configuration](Step_9_Component_Configuration_4cfa608.md) \(binding to the Component\).
91+
The text that is displayed on the UI is still hard-coded and not taken from the model - we will bind the property `greetingText` to our UI control in the next step.
9092
9193
> ### Note:
9294
> Models can be set on every control by calling `setModel()`. The model is then propagated to all aggregated child controls \(and their children, and so on…\). All child control will then have access to that model
9395
94-
The text that is displayed on the UI is still hard-coded and not taken from the model - we will bind the property `greetingText` to our UI control in the next step.
95-
9696
**Parent topic:**[Data Binding Tutorial](Data_Binding_Tutorial_e531093.md "In this tutorial, we will explain the concepts of data binding in OpenUI5.")
9797
9898
**Next:**[Step 1: No Data Binding](Step_1_No_Data_Binding_4cde849.md "In this step, we create a basic application and simply place some text on the screen using a standard sap.m.Text control. The text in this control is a hard-coded part of the control's definition; therefore, this is not an example of data binding!")

docs/Unit_Formatting_8e618a8.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ The third argument of the base Unit type constructor is a list of dynamic format
328328
> ### Caution:
329329
> **Legacy unit mapping is deprecated as of OpenUI5 1.122.0**
330330
>
331-
> With UI5 version 1.122.0, this map is no longer maintained; the state of this mapping is from UI5 version 1.119.0 and will remain for compatibility reasons only.
331+
> With UI5 version 1.122.0, this map is no longer maintained; the state of this mapping corresponds to UI5 version 1.119.0.
332332
333333
With the upgrade of the CLDR version from 35.1 to 41, released with OpenUI5 version 1.110, some unit keys have changed. To support the formatting of legacy unit keys, a mapping has been added. A user is able to load legacy unit keys from his back end, which are then mapped to the new unit keys. When parsing user input, only the new unit keys are returned. Updating or changing entries containing legacy unit keys results in replacing the legacy unit key with a new unit key.
334334

0 commit comments

Comments
 (0)