Skip to content

Commit 97f4bb5

Browse files
authored
Update concept.md
1 parent 47e8cf6 commit 97f4bb5

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

docs/advanced/technical/concept.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,43 @@ A typical "UI5-View Over the Wire" response looks like this:
9595
"UI5 Over the Wire" - Response with View & Data together
9696

9797

98+
#### Partial HTML Updates also possible?
99+
100+
A key feature of HTML over-the-wire is that the browser does not re-render the entire HTML page, but only specific parts. Can we achieve this with UI5? While modifying the XML view would typically trigger a complete re-render, focusing solely on updating the view model and binding UI attributes to it allows the UI5 framework to automatically update only the affected parts. Try out this snippet:
101+
102+
```abap
103+
CLASS z2ui5_cl_app_partly_rerender DEFINITION PUBLIC CREATE PUBLIC.
104+
105+
PUBLIC SECTION.
106+
INTERFACES z2ui5_if_app.
107+
DATA text TYPE string.
108+
DATA enabled TYPE abap_bool.
109+
110+
ENDCLASS.
111+
112+
CLASS z2ui5_cl_app_partly_rerender IMPLEMENTATION.
113+
114+
METHOD z2ui5_if_app~main.
115+
116+
IF client->check_on_init( ).
117+
118+
client->view_display( z2ui5_cl_xml_view=>factory(
119+
)->input( enabled = client->_bind( enabled ) value = client->_bind( text )
120+
)->button( text = 'partly rerender html' press = client->_event( 'POST' )
121+
)->stringify( ) ).
122+
123+
ELSE.
124+
125+
enabled = xsdbool( enabled = abap_false ).
126+
text = text && ` text`.
127+
client->view_model_update( ).
128+
129+
ENDIF.
130+
131+
ENDMETHOD.
132+
133+
ENDCLASS.
134+
```
98135

99136
#### Summary
100137

@@ -278,44 +315,7 @@ Limitations:
278315
- Offline functionality or complex client-side interactions are not covered.
279316
- Less effective if frontend and backend teams work independently.
280317

281-
#### Partial HTML Updates
282318

283-
A key feature of HTML over-the-wire is that the browser does not re-render the entire HTML page, but only specific parts. Can we achieve this with UI5? While modifying the XML view would typically trigger a complete re-render, focusing solely on updating the view model and binding UI attributes to it allows the UI5 framework to automatically update only the affected parts. Try out this snippet:
284-
285-
```abap
286-
CLASS z2ui5_cl_app_partly_rerender DEFINITION PUBLIC CREATE PUBLIC.
287-
288-
PUBLIC SECTION.
289-
INTERFACES z2ui5_if_app.
290-
DATA text TYPE string.
291-
DATA enabled TYPE abap_bool.
292-
293-
ENDCLASS.
294-
295-
CLASS z2ui5_cl_app_partly_rerender IMPLEMENTATION.
296-
297-
METHOD z2ui5_if_app~main.
298-
299-
IF client->check_on_init( ).
300-
301-
client->view_display( z2ui5_cl_xml_view=>factory(
302-
)->input( enabled = client->_bind( enabled ) value = client->_bind( text )
303-
)->button( text = 'partly rerender html' press = client->_event( 'POST' )
304-
)->stringify( ) ).
305-
306-
ELSE.
307-
308-
enabled = xsdbool( enabled = abap_false ).
309-
text = text && ` text`.
310-
client->view_model_update( ).
311-
312-
ENDIF.
313-
314-
ENDMETHOD.
315-
316-
ENDCLASS.
317-
```
318-
Isn't that beautiful?
319319

320320
#### Summary
321321

0 commit comments

Comments
 (0)