Skip to content

Commit e32eb9b

Browse files
authored
fix bind_local
1 parent 87c16f2 commit e32eb9b

7 files changed

+42
-41
lines changed

src/z2ui5_cl_demo_app_002.clas.abap

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ CLASS z2ui5_cl_demo_app_002 DEFINITION PUBLIC.
3636

3737

3838
DATA client TYPE REF TO z2ui5_if_client.
39-
39+
DATA mt_combo type ty_T_combo.
40+
4041
PROTECTED SECTION.
4142

4243
METHODS z2ui5_on_rendering.
@@ -177,14 +178,16 @@ CLASS z2ui5_cl_demo_app_002 IMPLEMENTATION.
177178
text = 'this is a checkbox'
178179
enabled = abap_true ).
179180

180-
lv_test->label( 'Combobox'
181-
)->combobox(
182-
selectedkey = client->_bind_edit( screen-combo_key )
183-
items = client->_bind_local( VALUE ty_t_combo(
181+
mt_combo = VALUE ty_t_combo(
184182
( key = 'BLUE' text = 'green' )
185183
( key = 'GREEN' text = 'blue' )
186184
( key = 'BLACK' text = 'red' )
187-
( key = 'GRAY' text = 'gray' ) ) )
185+
( key = 'GRAY' text = 'gray' ) ).
186+
187+
lv_test->label( 'Combobox'
188+
)->combobox(
189+
selectedkey = client->_bind_edit( screen-combo_key )
190+
items = client->_bind( mt_combo )
188191
)->item(
189192
key = '{KEY}'
190193
text = '{TEXT}'
@@ -193,11 +196,7 @@ CLASS z2ui5_cl_demo_app_002 IMPLEMENTATION.
193196
lv_test->label( 'Combobox2'
194197
)->combobox(
195198
selectedkey = client->_bind_edit( screen-combo_key2 )
196-
items = client->_bind_local( VALUE ty_t_combo(
197-
( key = 'BLUE' text = 'green' )
198-
( key = 'GREEN' text = 'blue' )
199-
( key = 'BLACK' text = 'red' )
200-
( key = 'GRAY' text = 'gray' ) ) )
199+
items = client->_bind( mt_combo )
201200
)->item(
202201
key = '{KEY}'
203202
text = '{TEXT}'
@@ -251,4 +250,4 @@ CLASS z2ui5_cl_demo_app_002 IMPLEMENTATION.
251250
client->view_display( page->stringify( ) ).
252251

253252
ENDMETHOD.
254-
ENDCLASS.
253+
ENDCLASS.

src/z2ui5_cl_demo_app_035.clas.abap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ CLASS z2ui5_cl_demo_app_035 DEFINITION PUBLIC.
1010

1111

1212
DATA client TYPE REF TO z2ui5_if_client.
13-
DATA: lt_types TYPE z2ui5_if_types=>ty_t_name_value.
13+
DATA lt_types TYPE z2ui5_if_types=>ty_t_name_value.
1414
METHODS view_display.
1515

1616
PROTECTED SECTION.
@@ -41,7 +41,7 @@ CLASS z2ui5_cl_demo_app_035 IMPLEMENTATION.
4141
v = shift_right( shift_left( row ) ) ) ).
4242

4343
DATA(temp3) = temp->input( value = client->_bind_edit( mv_type )
44-
suggestionitems = client->_bind_local( lt_types )
44+
suggestionitems = client->_bind( lt_types )
4545
)->get( ).
4646

4747
temp3->suggestion_items(
@@ -110,4 +110,4 @@ CLASS z2ui5_cl_demo_app_035 IMPLEMENTATION.
110110
client->nav_app_leave( ).
111111
ENDCASE.
112112
ENDMETHOD.
113-
ENDCLASS.
113+
ENDCLASS.

src/z2ui5_cl_demo_app_058.clas.abap

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ CLASS z2ui5_cl_demo_app_058 DEFINITION PUBLIC.
5959
DATA mv_layout TYPE string.
6060
DATA mv_check_sort TYPE abap_bool.
6161

62-
62+
DATA mt_combo type ty_T_combo.
6363

6464
PROTECTED SECTION.
6565

@@ -252,6 +252,12 @@ CLASS z2ui5_cl_demo_app_058 IMPLEMENTATION.
252252

253253
DATA(lo_tab) = ro_popup->tab_container( ).
254254

255+
mt_combo = VALUE ty_t_combo(
256+
( key = 'None' text = 'None' )
257+
( key = 'SingleSelect' text = 'SingleSelect' )
258+
( key = 'SingleSelectLeft' text = 'SingleSelectLeft' )
259+
( key = 'MultiSelect' text = 'MultiSelect' ) ).
260+
255261
lo_tab->tab( text = 'Table'
256262
selected = client->_bind_edit( mv_check_table )
257263
)->simple_form( editable = abap_true
@@ -265,11 +271,7 @@ CLASS z2ui5_cl_demo_app_058 IMPLEMENTATION.
265271
)->label( 'sel mode'
266272
)->combobox(
267273
selectedkey = client->_bind_edit( ms_layout-selmode )
268-
items = client->_bind_local( VALUE ty_t_combo(
269-
( key = 'None' text = 'None' )
270-
( key = 'SingleSelect' text = 'SingleSelect' )
271-
( key = 'SingleSelectLeft' text = 'SingleSelectLeft' )
272-
( key = 'MultiSelect' text = 'MultiSelect' ) ) )
274+
items = client->_bind( mt_combo )
273275
)->item(
274276
key = '{KEY}'
275277
text = '{TEXT}' ).
@@ -365,4 +367,4 @@ CLASS z2ui5_cl_demo_app_058 IMPLEMENTATION.
365367
( product = 'table2' create_date = `01.01.2023` create_by = `Peter` storage_location = `AREA_001` quantity = 400 ) ).
366368

367369
ENDMETHOD.
368-
ENDCLASS.
370+
ENDCLASS.

src/z2ui5_cl_demo_app_071.clas.abap

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ CLASS z2ui5_cl_demo_app_071 DEFINITION PUBLIC.
1313

1414
DATA mv_set_size_limit TYPE i VALUE 100.
1515
DATA mv_combo_number TYPE i VALUE 105.
16-
16+
DATA lt_combo TYPE ty_t_combo.
1717

1818
PROTECTED SECTION.
1919
PRIVATE SECTION.
@@ -42,8 +42,6 @@ CLASS z2ui5_cl_demo_app_071 IMPLEMENTATION.
4242
ENDCASE.
4343

4444

45-
46-
DATA(lt_combo) = VALUE ty_t_combo( ).
4745
DO mv_combo_number TIMES.
4846
INSERT VALUE #( key = sy-index text = sy-index ) INTO TABLE lt_combo.
4947
ENDDO.
@@ -63,7 +61,7 @@ CLASS z2ui5_cl_demo_app_071 IMPLEMENTATION.
6361
)->label( 'Number of Entries'
6462
)->input( value = client->_bind_edit( mv_combo_number )
6563
)->label( 'demo'
66-
)->combobox( items = client->_bind_local( lt_combo )
64+
)->combobox( items = client->_bind( lt_combo )
6765
)->item( key = '{KEY}' text = '{TEXT}'
6866
)->get_parent( )->get_parent(
6967
)->button(
@@ -72,4 +70,4 @@ CLASS z2ui5_cl_demo_app_071 IMPLEMENTATION.
7270
)->stringify( ) ).
7371

7472
ENDMETHOD.
75-
ENDCLASS.
73+
ENDCLASS.

src/z2ui5_cl_demo_app_080.clas.abap

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ CLASS z2ui5_cl_demo_app_080 DEFINITION
3636
END OF ty_s_people .
3737

3838
DATA mt_people TYPE STANDARD TABLE OF ty_s_people.
39+
DATA lv_s_date TYPE string.
3940

4041
PROTECTED SECTION.
4142

@@ -51,12 +52,12 @@ ENDCLASS.
5152

5253

5354

54-
CLASS Z2UI5_CL_DEMO_APP_080 IMPLEMENTATION.
55+
CLASS z2ui5_cl_demo_app_080 IMPLEMENTATION.
5556

5657

5758
METHOD z2ui5_display_view.
5859

59-
DATA(lv_s_date) = '2023-04-22T08:15:00'.
60+
lv_s_date = '2023-04-22T08:15:00'.
6061
DATA(view) = z2ui5_cl_xml_view=>factory( ).
6162

6263
view->_generic_property( VALUE #( n = `core:require` v = `{Helper:'z2ui5/Util'}` ) ).
@@ -70,8 +71,8 @@ CLASS Z2UI5_CL_DEMO_APP_080 IMPLEMENTATION.
7071
DATA(lo_vbox) = page->vbox( class ='sapUiSmallMargin' ).
7172

7273
DATA(lo_planningcalendar) = lo_vbox->planning_calendar(
73-
startdate = `{= Helper.DateCreateObject($` && client->_bind_local( lv_s_date ) && ') }'
74-
rows = `{path: '` && client->_bind_local( val = mt_people path = abap_true ) && `'}`
74+
startdate = `{= Helper.DateCreateObject($` && client->_bind( lv_s_date ) && ') }'
75+
rows = `{path: '` && client->_bind( val = mt_people path = abap_true ) && `'}`
7576
appointmentselect = client->_event( val = 'AppSelected' t_arg = VALUE #( ( `${$parameters>/appointment/mProperties/title}`) ) )
7677
showweeknumbers = abap_true ).
7778

@@ -152,4 +153,4 @@ CLASS Z2UI5_CL_DEMO_APP_080 IMPLEMENTATION.
152153
( start = '2023-04-22T08:15:00' end = '2023-04-23T08:15:00' type = 'Type11' title = 'Reminder11' tentative = abap_true )
153154
( start = '2023-04-25T10:30:00' end = '2023-04-26T11:30:00' type = 'Type12' title = 'Reminder21' tentative = abap_false ) ) ) ).
154155
ENDMETHOD.
155-
ENDCLASS.
156+
ENDCLASS.

src/z2ui5_cl_demo_app_085.clas.abap

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ CLASS z2ui5_cl_demo_app_085 DEFINITION
4747
DATA mt_table_supplier TYPE ty_t_table_supplier .
4848
DATA check_initialized TYPE abap_bool .
4949
DATA mv_search_value TYPE string.
50+
DATA ls_detail TYPE ty_s_tab .
5051
PROTECTED SECTION.
5152

5253
DATA client TYPE REF TO z2ui5_if_client .
@@ -60,7 +61,6 @@ CLASS z2ui5_cl_demo_app_085 DEFINITION
6061
PRIVATE SECTION.
6162

6263
DATA lv_layout TYPE string .
63-
DATA ls_detail TYPE ty_s_tab .
6464
DATA lv_sort_desc TYPE abap_bool VALUE abap_true.
6565
DATA c_pic_url TYPE string VALUE 'https://sapui5.hana.ondemand.com/sdk/test-resources/sap/ui/documentation/sdk/images/'.
6666
DATA ls_detail_supplier TYPE ty_s_tab_supplier .
@@ -100,7 +100,7 @@ CLASS Z2UI5_CL_DEMO_APP_085 IMPLEMENTATION.
100100
header_title->expanded_heading(
101101
)->hbox(
102102
* )->title( Text = |Product Id |
103-
)->info_label( text = |Product Id | && client->_bind_local( val = ls_detail-productid )
103+
)->info_label( text = |Product Id | && client->_bind( ls_detail-productid )
104104
colorscheme = '9'
105105
width = '200px'
106106
icon = 'sap-icon://home-share' ).
@@ -109,14 +109,14 @@ CLASS Z2UI5_CL_DEMO_APP_085 IMPLEMENTATION.
109109
)->flex_box( alignitems = `Center`
110110
)->avatar( src = c_pic_url && ls_detail-pic
111111
class = 'sapUiTinyMarginEnd'
112-
)->info_label( text = |Product Id | && client->_bind_local( val = ls_detail-productid )
112+
)->info_label( text = |Product Id | && client->_bind( ls_detail-productid )
113113
colorscheme = '9'
114114
width = '200px'
115115
icon = 'sap-icon://home-share' ).
116116

117-
header_title->expanded_content( ns = `uxap` )->text( client->_bind_local( val = ls_detail-productname ) ).
118-
header_title->snapped_content( ns = `uxap` )->text( client->_bind_local( val = ls_detail-productname ) ).
119-
header_title->snapped_title_on_mobile( )->title( client->_bind_local( val = ls_detail-productname ) ).
117+
header_title->expanded_content( ns = `uxap` )->text( client->_bind( ls_detail-productname ) ).
118+
header_title->snapped_content( ns = `uxap` )->text( client->_bind( ls_detail-productname ) ).
119+
header_title->snapped_title_on_mobile( )->title( client->_bind( ls_detail-productname ) ).
120120

121121
header_title->actions( ns = `uxap` )->overflow_toolbar(
122122
)->overflow_toolbar_button(
@@ -568,4 +568,4 @@ CLASS Z2UI5_CL_DEMO_APP_085 IMPLEMENTATION.
568568
ENDIF.
569569

570570
ENDMETHOD.
571-
ENDCLASS.
571+
ENDCLASS.

src/z2ui5_cl_demo_app_130.clas.abap

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,13 @@ CLASS z2ui5_cl_demo_app_130 IMPLEMENTATION.
393393
IF mt_fields IS NOT INITIAL.
394394

395395
LOOP AT mt_fields REFERENCE INTO DATA(lr_tab).
396+
data(lv_tabix) = sy-tabix.
396397

397398
DATA(scrtext) = get_txt( CONV #( lr_tab->field_doma ) ).
398399

399400
content->label( text = scrtext
400401
)->multi_input(
401-
tokens = client->_bind_local( lr_tab->t_token )
402+
tokens = client->_bind( val = lr_tab->t_token tab = mt_fields tab_index = lv_tabix )
402403
showclearicon = abap_true
403404
id = lr_tab->field
404405
valuehelprequest = client->_event( val = 'CALL_POPUP_FILTER' t_arg = VALUE #( ( CONV #( lr_tab->field ) ) ) )
@@ -716,4 +717,4 @@ CLASS z2ui5_cl_demo_app_130 IMPLEMENTATION.
716717
client->view_model_update( ).
717718

718719
ENDMETHOD.
719-
ENDCLASS.
720+
ENDCLASS.

0 commit comments

Comments
 (0)