Skip to content

Commit df0b992

Browse files
committed
Merge View > Overview into Definition
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.
1 parent 7ef1691 commit df0b992

3 files changed

Lines changed: 49 additions & 82 deletions

File tree

docs/.vitepress/config.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,9 @@ export default defineConfig({
124124
items: [
125125
{
126126
text: "View",
127-
link: "/cookbook/view/overview",
127+
link: "/cookbook/view/definition",
128128
collapsed: true,
129129
items: [
130-
{ text: "Overview", link: "/cookbook/view/overview" },
131130
{ text: "Definition", link: "/cookbook/view/definition" },
132131
{ text: "Nested Views", link: "/cookbook/view/nested_views" },
133132
{ text: "XML Templating", link: "/cookbook/view/xml_templating" },

docs/cookbook/view/definition.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ outline: [2, 4]
33
---
44
# Definition
55

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.
713

814
```abap
915
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
2026
2127
ENDMETHOD.
2228
```
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:
2435

2536
```abap
2637
METHOD z2ui5_if_app~main.
@@ -35,6 +46,8 @@ You can use any UI5 control from the [UI5 SDK](https://sapui5.hana.ondemand.com)
3546
ENDMETHOD.
3647
```
3748

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+
3851
Tips for working with views:
3952
- Use code completion on `Z2UI5_CL_XML_VIEW` to find controls and properties
4053
- 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
5265
The ABAP compiler cannot catch these mistakes — they are pure UI5 concerns and must be verified against the SDK documentation.
5366
:::
5467

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.
80+
81+
| Need | Use | Notes |
82+
| --------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------- |
83+
| Tabular data, columns, sorting | `sap.m.Table` | Responsive, supports growing/p13n. Default choice for business data. |
84+
| Flat list with icons/avatars | `sap.m.List` with `StandardListItem` | Lighter than `Table` when columns are not needed. |
85+
| Hierarchical data (parent/child) | `sap.m.Tree` or `sap.ui.table.TreeTable` | `Tree` is responsive; `TreeTable` shows fixed columns. |
86+
| Form with labels + inputs | `sap.ui.layout.form.SimpleForm` | Use this 90% of the time — auto-layouts labels and fields responsively. |
87+
| Form with custom grid layout | `sap.ui.layout.form.Form` | When `SimpleForm` is not flexible enough. |
88+
| App page with title and content | `sap.m.Page` | The standard container. Wrap in `sap.m.Shell` for the SAP frame. |
89+
| Page with collapsible header | `sap.f.DynamicPage` | For object pages and analytics screens. |
90+
| Page with action toolbar | `sap.f.semantic.SemanticPage` | Adds semantic actions (edit, delete, share) in the footer. |
91+
| Vertical / horizontal stack | `sap.m.VBox` / `sap.m.HBox` | Quick layout without a form. |
92+
| Tabs | `sap.m.IconTabBar` | Use `IconTabFilter` for each tab. |
93+
| Single-select dropdown | `sap.m.Select` (≤ 20 items) / `sap.m.ComboBox` | `ComboBox` allows typing and filtering. |
94+
| 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+
55101
## Mapping UI5 XML ↔ ABAP Fluent API
56102

57103
`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:

docs/cookbook/view/overview.md

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)