Skip to content

Commit 019fc1f

Browse files
committed
update
1 parent e3a0ee4 commit 019fc1f

File tree

1 file changed

+3
-45
lines changed

1 file changed

+3
-45
lines changed

src/03/z2ui5add_cl_ws_sample_01.clas.abap

+3-45
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,13 @@ CLASS z2ui5add_cl_ws_sample_01 DEFINITION PUBLIC.
33
PUBLIC SECTION.
44

55
INTERFACES z2ui5_if_app.
6-
7-
TYPES:
8-
BEGIN OF ty_row,
9-
title TYPE string,
10-
value TYPE string,
11-
descr TYPE string,
12-
icon TYPE string,
13-
info TYPE string,
14-
checkbox TYPE abap_bool,
15-
END OF ty_row.
16-
DATA t_tab TYPE STANDARD TABLE OF ty_row WITH EMPTY KEY.
17-
18-
DATA mv_counter TYPE i.
196
data mv_message type string.
20-
DATA mv_check_active TYPE abap_bool.
217

228
PROTECTED SECTION.
239

2410
DATA client TYPE REF TO z2ui5_if_client.
2511
DATA check_initialized TYPE abap_bool.
2612

27-
METHODS z2ui5_on_init.
2813
METHODS z2ui5_on_event.
2914
METHODS z2ui5_view_display.
3015

@@ -41,7 +26,6 @@ CLASS z2ui5add_cl_ws_sample_01 IMPLEMENTATION.
4126

4227
IF check_initialized = abap_false.
4328
check_initialized = abap_true.
44-
z2ui5_on_init( ).
4529
z2ui5_view_display( ).
4630
ENDIF.
4731

@@ -59,8 +43,6 @@ CLASS z2ui5add_cl_ws_sample_01 IMPLEMENTATION.
5943
WHEN 'WS_MESSAGE_RECEIVED'.
6044
client->message_box_display( `Message receiced: ` && mv_message ).
6145

62-
* client->view_model_update( ).
63-
6446
WHEN 'BACK'.
6547
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ).
6648

@@ -69,44 +51,20 @@ CLASS z2ui5add_cl_ws_sample_01 IMPLEMENTATION.
6951
ENDMETHOD.
7052

7153

72-
METHOD z2ui5_on_init.
73-
74-
mv_counter = 1.
75-
mv_check_active = abap_true.
76-
77-
t_tab = VALUE #(
78-
( title = 'entry' && mv_counter info = 'completed' descr = 'this is a description' icon = 'sap-icon://account' ) ).
79-
80-
ENDMETHOD.
81-
8254

8355
METHOD z2ui5_view_display.
8456

8557
DATA(lo_view) = z2ui5_cl_xml_view=>factory( ).
8658

8759
lo_view->_z2ui5( )->websocket(
8860
received = client->_event( 'WS_MESSAGE_RECEIVED' )
89-
value = client->_bind_edit( mv_message )
90-
checkactive = client->_bind( mv_check_active ) ).
61+
value = client->_bind_edit( mv_message ) ).
9162

9263
DATA(page) = lo_view->shell( )->page(
93-
title = 'abap2UI5 - Websocket - Receive Data'
64+
title = 'abap2UI5 - Websocket - This app just waits for messages...'
9465
navbuttonpress = client->_event( 'BACK' )
9566
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
96-
)->header_content(
97-
)->link( text = 'Demo' target = '_blank' href = `https://twitter.com/abap2UI5/status/1645816100813152256`
98-
)->link(
99-
text = 'Source_Code' target = '_blank'
100-
)->get_parent( ).
101-
102-
page->list(
103-
headertext = 'Data auto refresh (2 sec)'
104-
items = client->_bind( t_tab )
105-
)->standard_list_item(
106-
title = '{TITLE}'
107-
description = '{DESCR}'
108-
icon = '{ICON}'
109-
info = '{INFO}' ).
67+
).
11068

11169
client->view_display( lo_view->stringify( ) ).
11270

0 commit comments

Comments
 (0)