Skip to content

Commit 032539a

Browse files
authored
Update hello_world.md
1 parent 070fdef commit 032539a

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

docs/get_started/hello_world.md

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ ENDCLASS.
3636
CLASS z2ui5_cl_app_hello_world IMPLEMENTATION.
3737
METHOD z2ui5_if_app~main.
3838
39-
client->view_display( z2ui5_cl_xml_view=>factory(
39+
DATA(view) = z2ui5_cl_xml_view=>factory(
4040
)->page( `abap2UI5 - Hello World`
41-
)->text( `My Text`
42-
)->stringify( ) ).
41+
)->text( `My Text` ).
42+
client->view_display( view->stringify( ) ).
4343
4444
ENDMETHOD.
4545
ENDCLASS.
@@ -58,19 +58,23 @@ ENDCLASS.
5858
5959
CLASS z2ui5_cl_app_hello_world IMPLEMENTATION.
6060
METHOD z2ui5_if_app~main.
61+
CASE abap_true.
6162
62-
client->view_display( z2ui5_cl_xml_view=>factory(
63-
)->page( `abap2UI5 - Hello World`
63+
WHEN client->check_on_init( ).
64+
65+
DATA(view) = z2ui5_cl_xml_view=>factory(
66+
)->page( `abap2UI5 - Hello World`
6467
)->text( `My Text`
65-
)->button( text = `post` press = client->_event( `POST` )
66-
)->stringify( ) ).
68+
)->button( text = `post` press = client->_event( `POST` ) ).
69+
client->view_display( view->stringify( ) ).
70+
71+
72+
WHEN client->check_on_event( `POST` ).
6773
68-
CASE client->get( )-event.
69-
WHEN `POST`.
7074
client->message_box_display( `Hello World!` ).
71-
RETURN.
72-
ENDCASE.
7375
76+
77+
ENDCASE.
7478
ENDMETHOD.
7579
ENDCLASS.
7680
```
@@ -88,20 +92,24 @@ ENDCLASS.
8892
8993
CLASS z2ui5_cl_app_hello_world IMPLEMENTATION.
9094
METHOD z2ui5_if_app~main.
95+
CASE abap_true.
9196
92-
client->view_display( z2ui5_cl_xml_view=>factory(
93-
)->page( `abap2UI5 - Hello World`
97+
WHEN client->check_on_init( ).
98+
99+
DATA(view) = z2ui5_cl_xml_view=>factory(
100+
)->page( `abap2UI5 - Hello World`
94101
)->text( `My Text`
95102
)->button( text = `post` press = client->_event( `POST` )
96-
)->input( client->_bind_edit( name )
97-
)->stringify( ) ).
103+
)->input( client->_bind_edit( name ) ).
104+
client->view_display( view->stringify( ) ).
105+
106+
107+
WHEN client->check_on_event( `POST` ).
98108
99-
CASE client->get( )-event.
100-
WHEN `POST`.
101109
client->message_box_display( |Your name is { name }.| ).
102-
RETURN.
103-
ENDCASE.
104110
111+
112+
ENDCASE.
105113
ENDMETHOD.
106114
ENDCLASS.
107115
```

0 commit comments

Comments
 (0)