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
<em>Freestyle - ABAP Stack delivers only Data</em>
62
62
</p>
63
63
64
+
64
65
Because UI5 is a client-side rendering framework, HTML cannot be generated on the backend and sent to the client. Instead, HTML must be generated in the browser using JavaScript and the UI5 framework.
65
66
66
67
#### How can we send the View from the backend?
@@ -91,39 +92,65 @@ The frontend remains unaware of the current view structure (e.g., table, list, i
With this approach, the static logic remains in the frontend, while the backend handles the dynamic logic through ABAP classes. Each app becomes a self-contained ABAP class—no need for dedicated frontend apps anymore. Previously, we had to maintain many frontend artifacts:
#### How Can We Exchange Data and Make It Editable?
105
116
106
117
So far, we’ve seen how to display data in a backend-driven approach. But how do we handle changes made on the frontend? If we still rely on OData, any update would typically be routed into the OData implementation layer, not into the ABAP class that also defines the view in abap2UI5. To solve this, abap2UI5 uses the concept of a View Model.
107
118
108
119
In standard UI5, view models (often JSON models) are used to bind attributes such as visible or enabled:
Here comes the second key shift: Instead of binding to OData, abap2UI5 binds to a custom JSON model, explicitly assembled in the backend. This model is sent together with the view to the frontend:
This means we no longer consume CDS Views or OData services directly on the frontend. Instead, we send the view and its data model together from the backend. Any changes made in the UI can then be sent directly back to the backend via simple AJAX, without OData routing.
117
136
118
137
The abap2UI5 framework provides binding helpers and handles editable states, field values, and validation—all within ABAP classes. App developers do not need to deal with model configuration or UI binding logic manually.
119
138
120
139
A typical response from the backend now includes both the UI definition (view) and the data model:
we can not consume odata or cds directly in the abap layer and only send the view + view model to the frontend. furthermore we can use make tings editable and send it directly to the backend and exchange data.
129
156
@@ -137,16 +164,13 @@ Consider this example:
137
164
138
165
```abap
139
166
CLASS z2ui5_cl_demo_app_025 DEFINITION PUBLIC CREATE PUBLIC.
140
-
141
167
PUBLIC SECTION.
142
168
INTERFACES z2ui5_if_app.
143
169
DATA text TYPE string.
144
170
DATA partly TYPE abap_bool.
145
-
146
171
ENDCLASS.
147
172
148
173
CLASS z2ui5_cl_demo_app_025 IMPLEMENTATION.
149
-
150
174
METHOD z2ui5_if_app~main.
151
175
152
176
text = text && ` text`.
@@ -156,19 +180,17 @@ CLASS z2ui5_cl_demo_app_025 IMPLEMENTATION.
0 commit comments