Skip to content

Commit adecee6

Browse files
authored
Merge pull request #127 from abap2UI5/claude/update-binding-docs
Update binding docs for the unified two-way _bind
2 parents c1851ca + 4dee671 commit adecee6

36 files changed

Lines changed: 149 additions & 145 deletions

docs/advanced/agent.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Views, events, binding, navigation, messages — everything goes through the `cl
8181
|---|---|
8282
| Views | `view_display`, `view_destroy`, `view_model_update` |
8383
| Popups / popovers | `popup_display`, `popup_destroy`, `popover_display`, `popover_destroy` |
84-
| Binding | `_bind( var )` (read-only), `_bind_edit( var )` (two-way) |
84+
| Binding | `_bind( var )` (read-only), `_bind( var )` (two-way) |
8585
| Events | `_event( 'NAME' )`, `check_on_event( 'NAME' )`, `get_event_arg( i )` |
8686
| Navigation | `nav_app_call( app )`, `nav_app_leave( )`, `get_app_prev( )` |
8787
| Messages | `message_box_display`, `message_toast_display` |
@@ -106,7 +106,7 @@ Translate any UI5 XML example from the [UI5 SDK](https://sapui5.hana.ondemand.co
106106
|---|---|
107107
| `<Button text="Send" />` | `->__( n = `Button` a = `text` v = `Send` )` |
108108
| `press="onPress"` | `a = `press` v = client->_event( `BUTTON_POST` )` |
109-
| `value="{/name}"` | `a = `value` v = client->_bind_edit( name )` |
109+
| `value="{/name}"` | `a = `value` v = client->_bind( name )` |
110110
| `<FeedInput><actions>…</actions></FeedInput>` | `->_( `FeedInput` )->_( `actions` )->__( … )` |
111111

112112
Builder methods:
@@ -132,7 +132,7 @@ CLASS zcl_app_xxx DEFINITION PUBLIC.
132132
133133
PUBLIC SECTION.
134134
INTERFACES z2ui5_if_app.
135-
" bound data (public DATA attributes used by _bind / _bind_edit)
135+
" bound data (public DATA attributes used by _bind)
136136
137137
PROTECTED SECTION.
138138
DATA client TYPE REF TO z2ui5_if_client.
@@ -239,7 +239,7 @@ When an AI needs deeper information than this page provides:
239239
| Architecture, request roundtrip | [Concept](/technical/concept), [How It All Works](/technical/how_it_all_works) |
240240
| Lifecycle and `IF` / `ELSEIF` dispatcher pattern | [Cookbook → Life Cycle](/cookbook/event_navigation/life_cycle) |
241241
| Building views, control choice | [Cookbook → View Definition](/cookbook/view/definition) |
242-
| Data binding (`_bind`, `_bind_edit`) | [Cookbook → Binding](/cookbook/model/binding) |
242+
| Data binding (`_bind`) | [Cookbook → Binding](/cookbook/model/binding) |
243243
| Tables and trees | [Cookbook → Tables](/cookbook/model/tables), [Trees](/cookbook/model/trees) |
244244
| Events, actions, exceptions | [Cookbook → Event, Navigation](/cookbook/event_navigation/life_cycle) |
245245
| Popups and popovers | [Cookbook → Popup, Popover](/cookbook/popup_popover/popup) |

docs/configuration/launchpad.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Handle view changes and popups through the abap2UI5 backend as usual. But for na
5757
val = client->cs_event-cross_app_nav_to_ext
5858
t_arg = VALUE #(
5959
( `{ semanticObject: "Z2UI5_CL_LP_SAMPLE_04", action: "display" }` )
60-
( `$` && client->_bind_edit( nav_params ) ) ) ) )
60+
( `$` && client->_bind( nav_params ) ) ) ) )
6161
```
6262

6363
To navigate back to the previous Launchpad app, use `cross_app_nav_to_prev_app`:

docs/configuration/performance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ENDMETHOD.
4040
### Suggestions
4141
Want to tune your app further? A few tips:
4242
- Call `client->view_display` only when needed. Prefer `client->view_model_update` so the UI5 framework only re-renders controls that have changed.
43-
- Prefer `client->_bind`; use `client->_bind_edit` only when users need to make changes the backend processes. Otherwise, you'll cause needless data transfers.
43+
- Bind data with `client->_bind` — the framework sends only the paths the user actually edited back to ABAP (a delta), so read-only and untouched fields cost nothing on the return trip. (`_bind_edit` is an obsolete alias of `_bind`.)
4444
- Declare public attributes in your app class only for variables shown on the frontend. This keeps the framework from reading unused values.
4545
- Follow standard ABAP best practices, like cutting loops and choosing sorted tables, just like in any other ABAP project.
4646

docs/cookbook/browser_interaction/clipboard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ CLASS z2ui5_cl_sample_clipboard IMPLEMENTATION.
2424
2525
client->view_display( z2ui5_cl_xml_view=>factory(
2626
)->page(
27-
)->input( client->_bind_edit( mv_text )
27+
)->input( client->_bind( mv_text )
2828
)->button(
2929
text = `copy to clipboard`
3030
press = client->_event( `COPY` )

docs/cookbook/browser_interaction/soft_keyboard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ METHOD z2ui5_if_app~main.
2525
)->title( `Keyboard on/off`
2626
)->label( `Input`
2727
)->input( id = `ZINPUT`
28-
value = client->_bind_edit( input )
28+
value = client->_bind( input )
2929
showvaluehelp = abap_true
3030
valuehelprequest = client->_event( `CALL_KEYBOARD` )
3131
valuehelpiconsrc = `sap-icon://keyboard-and-mouse` ).

docs/cookbook/device_capabilities/audio.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ CLASS z2ui5_cl_sample_sound IMPLEMENTATION.
2626
DATA(view) = z2ui5_cl_xml_view=>factory( ).
2727
DATA(vbox) = view->page( )->vbox( ).
2828
vbox->input( id = `inputApp`
29-
value = client->_bind_edit( company_code )
29+
value = client->_bind( company_code )
3030
type = `Number`
3131
placeholder = `Company Code`
3232
submit = client->_event( `CHECK_INPUT` ) ).

docs/cookbook/device_capabilities/barcode_scanning.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ CLASS z2ui5_cl_sample_focus IMPLEMENTATION.
7272
)->label( `One`
7373
)->input(
7474
id = `id1`
75-
value = client->_bind_edit( one )
75+
value = client->_bind( one )
7676
submit = client->_event( `ONE_ENTER` )
7777
)->label( `Two`
7878
)->input(
7979
id = `id2`
80-
value = client->_bind_edit( two )
80+
value = client->_bind( two )
8181
submit = client->_event( `TWO_ENTER` ) ).
8282
8383
client->view_display( page->stringify( ) ).
@@ -118,7 +118,7 @@ CLASS z2ui5_cl_sample_sound IMPLEMENTATION.
118118
DATA(view) = z2ui5_cl_xml_view=>factory( ).
119119
DATA(vbox) = view->page( )->vbox( ).
120120
vbox->input( id = `inputApp`
121-
value = client->_bind_edit( company_code )
121+
value = client->_bind( company_code )
122122
type = `Number`
123123
placeholder = `Company Code`
124124
submit = client->_event( `CHECK_INPUT` ) ).

docs/cookbook/device_capabilities/camera.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ CLASS z2ui5_cl_demo_app_306 IMPLEMENTATION.
2121
IF client->check_on_init( ).
2222
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( )->page( `abap2UI5 - Device Camera Picture`
2323
)->_z2ui5( )->camera_picture(
24-
value = client->_bind_edit( mv_picture_base )
24+
value = client->_bind( mv_picture_base )
2525
onphoto = client->_event( `CAPTURE` ) ).
2626
client->view_display( page->stringify( ) ).
2727
ENDIF.

docs/cookbook/device_capabilities/geolocation.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ CLASS z2ui5_cl_sample_geolocation IMPLEMENTATION.
3030
)->page( )->_z2ui5(
3131
)->geolocation(
3232
finished = client->_event( `POST` )
33-
longitude = client->_bind_edit( longitude )
34-
latitude = client->_bind_edit( latitude )
35-
altitude = client->_bind_edit( altitude )
36-
altitudeaccuracy = client->_bind_edit( altitudeaccuracy )
37-
accuracy = client->_bind_edit( accuracy )
38-
speed = client->_bind_edit( speed )
33+
longitude = client->_bind( longitude )
34+
latitude = client->_bind( latitude )
35+
altitude = client->_bind( altitude )
36+
altitudeaccuracy = client->_bind( altitudeaccuracy )
37+
accuracy = client->_bind( accuracy )
38+
speed = client->_bind( speed )
3939
)->stringify( ) ).
4040
4141
CASE client->get( )-event.

docs/cookbook/device_capabilities/spreadsheet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ CLASS z2ui5_cl_sample_upload IMPLEMENTATION.
2727
client->view_display( z2ui5_cl_xml_view=>factory(
2828
)->page(
2929
)->_z2ui5( )->file_uploader(
30-
value = client->_bind_edit( mv_value )
31-
path = client->_bind_edit( mv_path )
30+
value = client->_bind( mv_value )
31+
path = client->_bind( mv_path )
3232
placeholder = `filepath here...`
3333
upload = client->_event( `UPLOAD` )
3434
)->stringify( ) ).

0 commit comments

Comments
 (0)