Skip to content

Commit b85f758

Browse files
oblomov-devclaude
andauthored
Use view_model_update instead of nest_view_model_update in samples (#691)
The main and nested views now share one root model (nested views inherit the main view's model via UI5 propagation), so refreshing the main model via view_model_update also refreshes the nested views. The nest-specific nest_view_model_update call is therefore redundant. - 065: switch the demo call, button label and comment to view_model_update. - 097 / 098: replace the nest call; where it was already paired with a view_model_update, collapse the two into the single remaining call. Claude-Session: https://claude.ai/code/session_01F4VXychqy741rejPzYwLxy Co-authored-by: Claude <noreply@anthropic.com>
1 parent f231e2a commit b85f758

3 files changed

Lines changed: 7 additions & 10 deletions

File tree

src/01/01/z2ui5_cl_demo_app_065.clas.abap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ CLASS z2ui5_cl_demo_app_065 IMPLEMENTATION.
4242
press = client->_event( `MAIN` )
4343
)->button( text = `Rerender only nested view`
4444
press = client->_event( `NEST` )
45-
)->button( text = `Update only nested MODEL (nest_view_model_update)`
45+
)->button( text = `Update only nested MODEL (view_model_update)`
4646
press = client->_event( `NEST_MODEL` )
4747
)->input( client->_bind( mv_input_main ) ).
4848

@@ -77,13 +77,13 @@ CLASS z2ui5_cl_demo_app_065 IMPLEMENTATION.
7777
method_insert = `addContent` ).
7878

7979
WHEN `NEST_MODEL`.
80-
" change only a nest-bound field and refresh the nested view's model
81-
" copy (no re-render of the nested XML) - this isolates the effect of
82-
" nest_view_model_update. Press "Rerender only nested view" first so
83-
" the nested view exists.
80+
" change only a nest-bound field and refresh the shared view model
81+
" (no re-render of the nested XML). The main and nested views share one
82+
" model, so view_model_update refreshes the nested view too. Press
83+
" "Rerender only nested view" first so the nested view exists.
8484
mv_count = mv_count + 1.
8585
mv_input_nest = |nest model updated #{ mv_count }|.
86-
client->nest_view_model_update( ).
86+
client->view_model_update( ).
8787
ENDCASE.
8888

8989
ENDMETHOD.

src/01/01/z2ui5_cl_demo_app_097.clas.abap

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ CLASS z2ui5_cl_demo_app_097 IMPLEMENTATION.
133133
WHEN `ROW_DELETE`.
134134

135135
DELETE t_tab2 WHERE uuid = client->get_event_arg( ).
136-
client->nest_view_model_update( ).
136+
client->view_model_update( ).
137137

138138
WHEN `SELCHANGE`.
139139
DATA(lt_sel) = t_tab.
@@ -145,7 +145,6 @@ CLASS z2ui5_cl_demo_app_097 IMPLEMENTATION.
145145

146146
mv_layout = `TwoColumnsMidExpanded`.
147147

148-
client->nest_view_model_update( ).
149148
client->view_model_update( ).
150149
ENDCASE.
151150

src/01/01/z2ui5_cl_demo_app_098.clas.abap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ CLASS z2ui5_cl_demo_app_098 IMPLEMENTATION.
166166
mv_title = client->get_event_arg( ).
167167
ENDIF.
168168

169-
client->nest_view_model_update( ).
170169
client->view_model_update( ).
171170
view_display_detail_detail( ).
172171

@@ -181,7 +180,6 @@ CLASS z2ui5_cl_demo_app_098 IMPLEMENTATION.
181180

182181
mv_layout = `TwoColumnsMidExpanded`.
183182

184-
client->nest_view_model_update( ).
185183
client->view_model_update( ).
186184

187185
view_display_detail( ).

0 commit comments

Comments
 (0)