You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(tutorials): resolve rendering and consistency issues across tutorials
- build: copy each tutorial's top-level assets/ folder into dist/<tutorial>/assets/
so root README images (navigation, databinding) no longer 404 on GitHub Pages
- navigation/odatav4/databinding: remove backticks from file-path headings that
rendered as gray code spans, and shift the heading hierarchy down one level to
match the walkthrough/quickstart outline (fence-aware; i18n code comments untouched)
- walkthrough: replace project-structure screenshots in steps 09/26/27/28 with
fenced ASCII folder trees, and delete the now-unused screenshot PNGs
- quickstart: fix steps 02/03 headings to use the .ts/.js dual notation
Copy file name to clipboardExpand all lines: packages/databinding/steps/01/README.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,27 @@
1
1
2
-
# Step 1: No Data Binding
2
+
##Step 1: No Data Binding
3
3
4
4
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!
5
5
6
-
## Preview
6
+
###Preview
7
7
8
8

9
9
10
10
You can view this step live: [🔗 Live Preview of Step 1](https://ui5.github.io/tutorials/databinding/build/01/index-cdn.html).
11
11
12
-
## Setup
12
+
###Setup
13
13
14
14
Open a terminal and install UI5 Tooling globally on your machine by executing the following command:
15
15
16
16
```sh
17
17
npm install --global @ui5/cli
18
18
```
19
19
20
-
## Coding
20
+
###Coding
21
21
22
22
You can download the solution for this step here: <spanclass="ts-only">[📥 Download step 1](https://ui5.github.io/tutorials/databinding/databinding-step-01.zip)<spanclass="lang-suffix"> (TS)</span></span><spanclass="js-only">[📥 Download step 1](https://ui5.github.io/tutorials/databinding/databinding-step-01-js.zip)<spanclass="lang-suffix"> (JS)</span></span>.
23
23
24
-
### Folder structure for this step
24
+
####Folder structure for this step
25
25
26
26
```text
27
27
webapp/
@@ -36,7 +36,7 @@ webapp/
36
36
37
37
2. Create a new file called `package.json` which will enable you to execute commands and consume packages from the [npm registry](https://www.npmjs.com/) via the npm command line interface. Enter the following content:
38
38
39
-
## package.json \(New\)
39
+
###package.json \(New\)
40
40
41
41
```json
42
42
{
@@ -55,7 +55,7 @@ webapp/
55
55
56
56
4. Create a new HTML file named `index.html` in your webapp folder and enter the following content:
57
57
58
-
## webapp/index.html \(New\)
58
+
###webapp/index.html \(New\)
59
59
60
60
```html
61
61
<!DOCTYPE html>
@@ -84,7 +84,7 @@ webapp/
84
84
85
85
5. Create a new file named `manifest.json` in the webapp folder; it's also known as the "app descriptor". All application-specific configuration options which we'll introduce in this tutorial will be added to this file. Enter the following content:
86
86
87
-
## webapp/manifest.json \(New\)
87
+
###webapp/manifest.json \(New\)
88
88
89
89
```json
90
90
{
@@ -129,7 +129,7 @@ webapp/
129
129
130
130
6. Create a new file named `Component.ts/.js` in the webapp folder. Enter the following content:
131
131
132
-
##`webapp/Component.ts/.js`\(New\)
132
+
### webapp/Component.ts/.js \(New\)
133
133
134
134
```ts
135
135
// webapp/Component.ts
@@ -162,7 +162,7 @@ sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) {
162
162
163
163
7. Create a new folder named `view` in the webapp folder. Then, create a new file `App.view.xml` within the `view` folder. We start by placing the `sap.m.Text` control into the XML view. Since the value of the control's text property is hard-coded, it doesn't relate to any data that might exist within a model object. Therefore, data binding is **not** used here.
164
164
165
-
## webapp/view/App.view.xml \(New\)
165
+
###webapp/view/App.view.xml \(New\)
166
166
167
167
```xml
168
168
<mvc:View
@@ -182,7 +182,7 @@ sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) {
182
182
183
183
12. Configure the tooling extensions we installed from npm in our UI5 Tooling setup, so we can use them in our project:
Copy file name to clipboardExpand all lines: packages/databinding/steps/02/README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
2
-
# Step 2: Creating a Model
2
+
##Step 2: Creating a Model
3
3
4
4
In this step, we create a model. It serves as a container for the data your application operates on.
5
5
@@ -24,17 +24,17 @@ An OData model, however, is a server-side model. This means that whenever an app
24
24
25
25
In this tutorial, we focus on JSON models since they're the simplest ones to work with.
26
26
27
-
## Preview
27
+
###Preview
28
28
29
29

30
30
31
31
You can view this step live: [🔗 Live Preview of Step 2](https://ui5.github.io/tutorials/databinding/build/02/index-cdn.html).
32
32
33
-
## Coding
33
+
###Coding
34
34
35
35
You can download the solution for this step here: <spanclass="ts-only">[📥 Download step 2](https://ui5.github.io/tutorials/databinding/databinding-step-02.zip)<spanclass="lang-suffix"> (TS)</span></span><spanclass="js-only">[📥 Download step 2](https://ui5.github.io/tutorials/databinding/databinding-step-02-js.zip)<spanclass="lang-suffix"> (JS)</span></span>.
36
36
37
-
### Folder structure for this step
37
+
####Folder structure for this step
38
38
39
39
```text
40
40
webapp/
@@ -49,7 +49,7 @@ webapp/
49
49
50
50
1. Create a new folder named `model` in the `webapp` folder. In this folder, create a file called `data.json` with the following content:
51
51
52
-
## webapp/model/data.json \(New\)
52
+
###webapp/model/data.json \(New\)
53
53
54
54
```json
55
55
{
@@ -59,7 +59,7 @@ webapp/
59
59
60
60
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.
Copy file name to clipboardExpand all lines: packages/databinding/steps/03/README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,19 @@
1
1
2
-
# Step 3: Create Property Binding
2
+
##Step 3: Create Property Binding
3
3
4
4
Although there is no visible difference, the text on the screen is now derived from model data.
5
5
6
-
## Preview
6
+
###Preview
7
7
8
8

9
9
10
10
You can view this step live: [🔗 Live Preview of Step 3](https://ui5.github.io/tutorials/databinding/build/03/index-cdn.html).
11
11
12
-
## Coding
12
+
###Coding
13
13
14
14
You can download the solution for this step here: <spanclass="ts-only">[📥 Download step 3](https://ui5.github.io/tutorials/databinding/databinding-step-03.zip)<spanclass="lang-suffix"> (TS)</span></span><spanclass="js-only">[📥 Download step 3](https://ui5.github.io/tutorials/databinding/databinding-step-03-js.zip)<spanclass="lang-suffix"> (JS)</span></span>.
15
15
16
-
### Folder structure for this step
16
+
####Folder structure for this step
17
17
18
18
```text
19
19
webapp/
@@ -28,7 +28,7 @@ webapp/
28
28
29
29
Assign the `text` property of the `sap.m.Text` control to the value `{/greetingText}`. The curly brackets enclosing a binding path \(binding syntax\) are automatically interpreted as a binding. These binding instances are called property bindings. In this scenario, the control's `text` property is bound to the `greetingText` property at the root of the default model. The slash \(`/`\) at the beginning of the binding path signifies an absolute binding path.
Copy file name to clipboardExpand all lines: packages/databinding/steps/04/README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,21 @@
1
1
2
-
# Step 4: Two-Way Data Binding
2
+
##Step 4: Two-Way Data Binding
3
3
4
4
In the examples we've looked at so far, we've displayed the value of a model property using a read-only field. We'll now change the user interface to display first and last name fields using `sap.m.Input` fields. We're also adding a check box control to enable or disable both input fields. This setup illustrates a feature known as "two-way data binding". As the view now contains more controls, we're also moving the view definition into an XML file.
5
5
6
-
## Preview
6
+
###Preview
7
7
8
-
### Two input fields and a checkbox to enable or disable them
8
+
####Two input fields and a checkbox to enable or disable them
9
9
10
10

11
11
12
12
You can view this step live: [🔗 Live Preview of Step 4](https://ui5.github.io/tutorials/databinding/build/04/index-cdn.html).
13
13
14
-
## Coding
14
+
###Coding
15
15
16
16
You can download the solution for this step here: <spanclass="ts-only">[📥 Download step 4](https://ui5.github.io/tutorials/databinding/databinding-step-04.zip)<spanclass="lang-suffix"> (TS)</span></span><spanclass="js-only">[📥 Download step 4](https://ui5.github.io/tutorials/databinding/databinding-step-04-js.zip)<spanclass="lang-suffix"> (JS)</span></span>.
17
17
18
-
### Folder structure for this step
18
+
####Folder structure for this step
19
19
20
20
```text
21
21
webapp/
@@ -30,7 +30,7 @@ webapp/
30
30
31
31
Replace the content of the `App.view.xml` file with the following content:
32
32
33
-
## webapp/view/App.view.xml
33
+
###webapp/view/App.view.xml
34
34
35
35
```xml
36
36
<mvc:View
@@ -75,7 +75,7 @@ Replace the content of the `App.view.xml` file with the following content:
75
75
76
76
Replace the content of the `data.json` file in the `model` folder with the following content:
Copy file name to clipboardExpand all lines: packages/databinding/steps/05/README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,21 @@
1
1
2
-
# Step 5: One-Way Data Binding
2
+
##Step 5: One-Way Data Binding
3
3
4
4
Unlike the two-way binding behavior we've seen, one-way data binding is also possible. In this case, data travels in one direction only: from the model, through the binding instance, to the consumer \(usually the property of a control\), but never in the other direction. Let's modify the previous example to use one-way data binding. This shows how you can switch off the flow of data from the user interface back to the model if needed.
5
5
6
-
## Preview
6
+
###Preview
7
7
8
-
### Two input fields and a checkbox
8
+
####Two input fields and a checkbox
9
9
10
10

11
11
12
12
You can view this step live: [🔗 Live Preview of Step 5](https://ui5.github.io/tutorials/databinding/build/05/index-cdn.html).
13
13
14
-
## Coding
14
+
###Coding
15
15
16
16
You can download the solution for this step here: <spanclass="ts-only">[📥 Download step 5](https://ui5.github.io/tutorials/databinding/databinding-step-05.zip)<spanclass="lang-suffix"> (TS)</span></span><spanclass="js-only">[📥 Download step 5](https://ui5.github.io/tutorials/databinding/databinding-step-05-js.zip)<spanclass="lang-suffix"> (JS)</span></span>.
17
17
18
-
### Folder structure for this step
18
+
####Folder structure for this step
19
19
20
20
```text
21
21
webapp/
@@ -30,7 +30,7 @@ webapp/
30
30
31
31
Insert the highlighted code into the `Component.ts/.js` file. The `init` function calls the init function of its parent, retrieves the default model instance bound to the component, and sets the default binding mode to one-way data binding.
Copy file name to clipboardExpand all lines: packages/databinding/steps/06/README.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,23 @@
1
1
2
-
# Step 6: Resource Models
2
+
##Step 6: Resource Models
3
3
4
4
Business applications often require language-specific \(translatable\) text used as labels and descriptions on the user interface.
5
5
6
6
The example we used at the start of this tutorial was quite simplistic as we stored language-specific text directly in a JSON model object. Generally speaking, unless language-specific text comes directly from a back-end system, it's not considered good programming practice to put translatable texts directly into a model. So, let's fix this by placing all translatable texts \(such as field labels\) into a resource bundle.
7
7
8
-
## Preview
8
+
###Preview
9
9
10
-
### The texts are now derived from a resource model \(No visual change to last step\)
10
+
####The texts are now derived from a resource model \(No visual change to last step\)
11
11
12
12
")
13
13
14
14
You can view this step live: [🔗 Live Preview of Step 6](https://ui5.github.io/tutorials/databinding/build/06/index-cdn.html).
15
15
16
-
## Coding
16
+
###Coding
17
17
18
18
You can download the solution for this step here: <spanclass="ts-only">[📥 Download step 6](https://ui5.github.io/tutorials/databinding/databinding-step-06.zip)<spanclass="lang-suffix"> (TS)</span></span><spanclass="js-only">[📥 Download step 6](https://ui5.github.io/tutorials/databinding/databinding-step-06-js.zip)<spanclass="lang-suffix"> (JS)</span></span>.
19
19
20
-
### Folder structure for this step
20
+
####Folder structure for this step
21
21
22
22
```text
23
23
webapp/
@@ -36,7 +36,7 @@ Create a new entry in the `manifest.json` file under the `models` entry as shown
36
36
37
37
Also add the `i18n` property to the `sap.app` section and modify the `title` and `description` property to use the corresponding texts from the `i18n.properties` as shown below.
38
38
39
-
## webapp/manifest.json
39
+
###webapp/manifest.json
40
40
41
41
```json
42
42
...
@@ -89,7 +89,7 @@ Also add the `i18n` property to the `sap.app` section and modify the `title` and
89
89
90
90
Update the `i18n.properties` and add the code shown below.
91
91
92
-
## webapp/i18n/i18n.properties \(New\)
92
+
###webapp/i18n/i18n.properties \(New\)
93
93
94
94
```properties
95
95
# App Descriptor
@@ -111,7 +111,7 @@ Language-specific text stored in resource models obeys the Java convention for i
111
111
112
112
Modify the data binding for the panel header and the labels in `App.view.xml` to include the model name. Note that a "greater than" character separates the model name and the property name. Also, i18n property names **must not** start with a slash character.
113
113
114
-
## webapp/view/App.view.xml
114
+
###webapp/view/App.view.xml
115
115
116
116
```xml
117
117
<mvc:View
@@ -152,7 +152,7 @@ Modify the data binding for the panel header and the labels in `App.view.xml` to
152
152
153
153
Remove the line `panelHeaderText : "Data Binding Basics"` from the model data in the `data.json` file. This text has now been moved to the resource model.
154
154
155
-
## webapp/model/data.json
155
+
###webapp/model/data.json
156
156
157
157
```json
158
158
{
@@ -164,7 +164,7 @@ Remove the line `panelHeaderText : "Data Binding Basics"` from the model data in
164
164
165
165
Remove the `init` function and the import of `sap/ui/model/BindingMode` from `Component.ts/.js` as we do not want to set the one-way binding mode anymore.
Copy file name to clipboardExpand all lines: packages/databinding/steps/07/README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,21 @@
1
1
2
-
# Step 7: \(Optional\) Resource Bundles and Multiple Languages
2
+
##Step 7: \(Optional\) Resource Bundles and Multiple Languages
3
3
4
4
Resource bundles exist to enable an app to run in multiple languages without the need to change any code. To demonstrate this feature, let's create a German version of the app – in fact, all we need to do is create a German version of the resource bundle file. In our code, we activate the German locale for the ResourceModel.
5
5
6
-
## Preview
6
+
###Preview
7
7
8
-
### The texts are now adapted for the German locale
8
+
####The texts are now adapted for the German locale
9
9
10
10

11
11
12
12
You can view this step live: [🔗 Live Preview of Step 7](https://ui5.github.io/tutorials/databinding/build/07/index-cdn.html).
13
13
14
-
## Coding
14
+
###Coding
15
15
16
16
You can download the solution for this step here: <spanclass="ts-only">[📥 Download step 7](https://ui5.github.io/tutorials/databinding/databinding-step-07.zip)<spanclass="lang-suffix"> (TS)</span></span><spanclass="js-only">[📥 Download step 7](https://ui5.github.io/tutorials/databinding/databinding-step-07-js.zip)<spanclass="lang-suffix"> (JS)</span></span>.
17
17
18
-
### Folder structure for this step
18
+
####Folder structure for this step
19
19
20
20
```text
21
21
webapp/
@@ -31,7 +31,7 @@ webapp/
31
31
└── manifest.json
32
32
```
33
33
34
-
## webapp/i18n/i18n\_de.properties \(New\)
34
+
###webapp/i18n/i18n\_de.properties \(New\)
35
35
36
36
In the `i18n` folder, duplicate the `i18n.properties` file and rename its copy to `i18n`**`_de`**`.properties`. Replace the English text with the German text provided below. The suffix `de` represents the locale for the German language. Since the `de` locale is already set in the `supportedLocales` configuration of the `manifest.json`, it will be taken into account.
0 commit comments