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
Absorb the UI5 1:1 framing, the 'Where to Look for Controls' pointers,
and the 'Choosing a Control' table into definition.md. Delete the
separate overview page and update the sidebar.
Copy file name to clipboardExpand all lines: docs/cookbook/view/definition.md
+48-2Lines changed: 48 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,13 @@ outline: [2, 4]
3
3
---
4
4
# Definition
5
5
6
-
In abap2UI5, UI5 renders the UI from an XML view that you build in ABAP. A simple example with raw XML:
6
+
abap2UI5 uses [SAP UI5](https://sapui5.hana.ondemand.com) on the frontend without modification. Whatever your ABAP code sends to the browser is a **standard UI5 XML view** — the same XML you would write in any UI5 freestyle project.
7
+
8
+
The consequence: **everything in the UI5 SDK works in abap2UI5 1:1**. Any control, any property, any namespace from the [UI5 Demo Kit](https://sapui5.hana.ondemand.com/sdk) is available. Copy the XML, paste it into your ABAP class, and it renders.
9
+
10
+
#### Sending a View
11
+
12
+
The simplest case: build an XML string and ship it to the client.
7
13
8
14
```abap
9
15
METHOD z2ui5_if_app~main.
@@ -20,7 +26,12 @@ In abap2UI5, UI5 renders the UI from an XML view that you build in ABAP. A simpl
20
26
21
27
ENDMETHOD.
22
28
```
23
-
You can use any UI5 control from the [UI5 SDK](https://sapui5.hana.ondemand.com). But writing raw XML quickly turns cumbersome. A handier approach is the `Z2UI5_CL_XML_VIEW` helper class, with a fluent API for building views. The `stringify( )` method at the end converts the view tree into an XML string that the framework sends to the frontend:
29
+
30
+
Swap `<Text>` for any other control from the SDK; the framework doesn't care.
31
+
32
+
#### Helper Class
33
+
34
+
Writing raw XML by hand quickly turns cumbersome. abap2UI5 ships the helper class `z2ui5_cl_xml_view` with a fluent API that mirrors the XML structure and gives you code completion. The `stringify( )` method at the end converts the view tree into an XML string that the framework sends to the frontend:
24
35
25
36
```abap
26
37
METHOD z2ui5_if_app~main.
@@ -35,6 +46,8 @@ You can use any UI5 control from the [UI5 SDK](https://sapui5.hana.ondemand.com)
35
46
ENDMETHOD.
36
47
```
37
48
49
+
Both snippets produce the exact same view. Use whichever you prefer — raw strings are fine for a handful of lines, the fluent API scales better for real apps.
50
+
38
51
Tips for working with views:
39
52
- Use code completion on `Z2UI5_CL_XML_VIEW` to find controls and properties
40
53
- See the [samples repository](/get_started/next#sample-apps) for ready-made XML examples to copy and adapt
@@ -52,6 +65,39 @@ Combining controls in a way that violates these rules can lead to broken renderi
52
65
The ABAP compiler cannot catch these mistakes — they are pure UI5 concerns and must be verified against the SDK documentation.
53
66
:::
54
67
68
+
#### Where to Look for Controls
69
+
70
+
Because UI5 XML is used 1:1, **the UI5 documentation is your reference** for anything visual:
71
+
72
+
-[UI5 Demo Kit](https://sapui5.hana.ondemand.com/sdk) — interactive samples for every control
73
+
-[UI5 Control API](https://sapui5.hana.ondemand.com/sdk/#/api) — properties, aggregations, events
74
+
75
+
Find a control you like in the UI5 docs, copy its XML, paste it into `view_display( )` — done. abap2UI5 has no separate control catalog to learn.
76
+
77
+
#### Choosing a Control
78
+
79
+
The UI5 SDK is large. The table below covers the choices that come up in almost every abap2UI5 app — use it as a starting point before diving into the SDK.
| Multi-select dropdown |`sap.m.MultiComboBox`| Pills appear inside the field. |
95
+
| Date / time input |`sap.m.DatePicker` / `sap.m.TimePicker` / `sap.m.DateTimePicker`| Needs a formatter — see [Binding → Data-Type Mapping](/cookbook/model/binding#data-type-mapping). |
96
+
| Status indicator |`sap.m.ObjectStatus`| Colored text + icon for state. |
97
+
| Modal dialog |`sap.m.Dialog` (built with `factory_popup`) | See [Popover](/cookbook/popup_popover/popover). |
98
+
99
+
When two controls fit, prefer the simpler one: `Table` over `TreeTable`, `SimpleForm` over `Form`, `Select` over `ComboBox`. Switch to the richer variant only when a concrete requirement justifies it.
100
+
55
101
## Mapping UI5 XML ↔ ABAP Fluent API
56
102
57
103
`Z2UI5_CL_XML_VIEW` is a hand-curated wrapper around UI5 controls. It does not cover every UI5 control, and the naming is not always a strict 1:1 mapping of the UI5 SDK:
0 commit comments