mirror of
https://github.com/abap2UI5/abap2UI5.git
synced 2025-04-29 20:46:17 +08:00

* Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * new demos * Update z2ui5_cl_app_hello_world.clas.xml * Update z2ui5_cl_app_hello_world.clas.xml * Update z2ui5_cl_app_hello_world.clas.abap * Update z2ui5_cl_app_hello_world.clas.abap * Update z2ui5_cl_http_handler.clas.locals_imp.abap * Update README.md * Update README.md * Update README.md * Update z2ui5_cl_http_handler.clas.locals_imp.abap * Update z2ui5_cl_http_handler.clas.testclasses.abap * update * abalint fix * update * hello world app * url params * unit tests * demos * demos * event data * events and refactoring
52 lines
1.4 KiB
ABAP
52 lines
1.4 KiB
ABAP
CLASS z2ui5_cl_app_hello_world DEFINITION PUBLIC.
|
|
|
|
PUBLIC SECTION.
|
|
|
|
INTERFACES z2ui5_if_app.
|
|
|
|
DATA product TYPE string.
|
|
DATA quantity TYPE string.
|
|
DATA check_initialized TYPE abap_bool.
|
|
|
|
PROTECTED SECTION.
|
|
PRIVATE SECTION.
|
|
ENDCLASS.
|
|
|
|
|
|
|
|
CLASS Z2UI5_CL_APP_HELLO_WORLD IMPLEMENTATION.
|
|
|
|
|
|
METHOD z2ui5_if_app~main.
|
|
|
|
IF check_initialized = abap_false.
|
|
check_initialized = abap_true.
|
|
product = 'tomato'.
|
|
quantity = '500'.
|
|
ENDIF.
|
|
|
|
CASE client->get( )-event.
|
|
WHEN 'BUTTON_POST'.
|
|
client->popup_message_toast( |{ product } { quantity } - send to the server| ).
|
|
ENDCASE.
|
|
|
|
client->set_next( VALUE #( xml_main = Z2UI5_CL_XML_VIEW=>factory(
|
|
)->shell(
|
|
)->page( title = 'abap2UI5 - z2ui5_cl_app_hello_world'
|
|
)->simple_form( title = 'Hello World' editable = abap_true
|
|
)->content( ns = `form`
|
|
)->title( 'Make an input here and send it to the server...'
|
|
)->label( 'quantity'
|
|
)->input( value = client->_bind( quantity )
|
|
)->label( 'product'
|
|
)->input(
|
|
value = product
|
|
enabled = abap_false
|
|
)->button(
|
|
text = 'post'
|
|
press = client->_event( 'BUTTON_POST' )
|
|
)->get_root( )->xml_get( ) ) ).
|
|
|
|
ENDMETHOD.
|
|
ENDCLASS.
|