Skip to content

Commit efff523

Browse files
authored
add demo sizelimit (#356)
1 parent 15f6b1d commit efff523

File tree

5 files changed

+105
-23
lines changed

5 files changed

+105
-23
lines changed

src/z2ui5_cl_demo_app_000.clas.abap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
6666
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
6767
)->header_content(
6868
)->toolbar_spacer(
69-
* )->link( text = 'SCN' target = '_blank' href = 'https://community.sap.com/t5/technology-blogs-by-members/abap2ui5-1-introduction-developing-ui5-apps-purely-in-abap/ba-p/13567635'
70-
* )->link( text = 'Twitter' target = '_blank' href = 'https://twitter.com/abap2UI5'
7169
)->link( text = 'Install with abapGit from GitHub' target = '_blank' href = 'https://github.com/oblomov-dev/abap2ui5'
7270
)->get_parent( ).
7371

src/z2ui5_cl_demo_app_001.clas.abap

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,34 @@ ENDCLASS.
1414

1515

1616

17-
CLASS Z2UI5_CL_DEMO_APP_001 IMPLEMENTATION.
17+
CLASS z2ui5_cl_demo_app_001 IMPLEMENTATION.
1818

1919

2020
METHOD z2ui5_if_app~main.
2121

2222
IF check_initialized = abap_false.
2323
check_initialized = abap_true.
2424

25-
product = 'tomato'.
25+
product = 'products'.
2626
quantity = '500'.
2727

2828
DATA(view) = z2ui5_cl_xml_view=>factory( ).
29-
client->view_display( view->shell(
30-
)->page(
31-
title = 'abap2UI5 - First Example'
32-
navbuttonpress = client->_event( val = 'BACK' s_ctrl = VALUE #( check_view_destroy = abap_true ) )
33-
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
34-
)->simple_form( title = 'Form Title' editable = abap_true
35-
)->content( 'form'
36-
)->title( 'Input'
37-
)->label( 'quantity'
38-
)->input( client->_bind_edit( quantity )
39-
)->label( `product`
40-
)->input( value = product enabled = abap_false
41-
)->button(
42-
text = 'post'
43-
press = client->_event( val = 'BUTTON_POST' )
44-
)->stringify( ) ).
29+
client->view_display( val = view->shell(
30+
)->page(
31+
title = 'abap2UI5 - First Example'
32+
navbuttonpress = client->_event( val = 'BACK' s_ctrl = VALUE #( check_view_destroy = abap_true ) )
33+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
34+
)->simple_form( title = 'Form Title' editable = abap_true
35+
)->content( 'form'
36+
)->title( 'Input'
37+
)->label( 'quantity'
38+
)->input( client->_bind_edit( quantity )
39+
)->label( `product`
40+
)->input( value = product enabled = abap_false
41+
)->button(
42+
text = 'post'
43+
press = client->_event( val = 'BUTTON_POST' )
44+
)->stringify( ) ).
4545

4646
ENDIF.
4747

src/z2ui5_cl_demo_app_002.clas.abap

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,15 @@ ENDCLASS.
5151

5252

5353

54-
CLASS Z2UI5_CL_DEMO_APP_002 IMPLEMENTATION.
54+
CLASS z2ui5_cl_demo_app_002 IMPLEMENTATION.
5555

5656

5757
METHOD z2ui5_if_app~main.
5858

5959
me->client = client.
6060

6161
IF check_initialized = abap_false.
62+
check_initialized = abap_true.
6263

6364
DATA(lv_script) = `` && |\n| &&
6465
`function setInputFIlter(){` && |\n| &&
@@ -81,8 +82,9 @@ CLASS Z2UI5_CL_DEMO_APP_002 IMPLEMENTATION.
8182
)->_generic( ns = `html` name = `script` )->_cc_plain_xml( lv_script
8283
)->stringify( ) ).
8384

84-
check_initialized = abap_true.
85+
8586
z2ui5_on_init( ).
87+
RETURN.
8688
ENDIF.
8789

8890
z2ui5_on_event( ).
@@ -151,7 +153,7 @@ CLASS Z2UI5_CL_DEMO_APP_002 IMPLEMENTATION.
151153
METHOD z2ui5_on_rendering.
152154

153155
DATA(view) = z2ui5_cl_xml_view=>factory( ).
154-
view->_generic( name = `script` ns = `html` )->_cc_plain_xml( `function callMessageToast(sAction) { sap.m.MessageToast.show('Hello there !!'); }` ).
156+
* view->_generic( name = `script` ns = `html` )->_cc_plain_xml( `function callMessageToast(sAction) { sap.m.MessageToast.show('Hello there !!'); }` ).
155157
DATA(page) = view->shell(
156158
)->page(
157159
showheader = xsdbool( abap_false = client->get( )-check_launchpad_active )
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
CLASS z2ui5_cl_demo_app_071 DEFINITION PUBLIC.
2+
3+
PUBLIC SECTION.
4+
5+
INTERFACES z2ui5_if_app.
6+
7+
TYPES:
8+
BEGIN OF s_combobox,
9+
key TYPE string,
10+
text TYPE string,
11+
END OF s_combobox.
12+
TYPES ty_t_combo TYPE STANDARD TABLE OF s_combobox WITH EMPTY KEY.
13+
14+
DATA mv_set_size_limit TYPE i VALUE 100.
15+
DATA mv_combo_number TYPE i VALUE 105.
16+
DATA check_initialized TYPE abap_bool.
17+
18+
PROTECTED SECTION.
19+
PRIVATE SECTION.
20+
ENDCLASS.
21+
22+
23+
24+
CLASS z2ui5_cl_demo_app_071 IMPLEMENTATION.
25+
26+
27+
METHOD z2ui5_if_app~main.
28+
29+
CASE client->get( )-event.
30+
WHEN 'BACK'.
31+
client->nav_app_leave( ).
32+
RETURN.
33+
ENDCASE.
34+
35+
client->message_toast_display( `View updated` ).
36+
37+
DATA(lt_combo) = VALUE ty_T_combo( ).
38+
DO mv_combo_number TIMES.
39+
INSERT VALUE #( key = sy-index text = sy-index ) INTO TABLE lt_combo.
40+
ENDDO.
41+
42+
DATA(view) = z2ui5_cl_xml_view=>factory( ).
43+
client->view_display( val = view->shell(
44+
)->page(
45+
title = 'abap2UI5 - First Example'
46+
navbuttonpress = client->_event( val = 'BACK' s_ctrl = VALUE #( check_view_destroy = abap_true ) )
47+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
48+
)->simple_form( title = 'Form Title' editable = abap_true
49+
)->content( 'form'
50+
)->title( 'Input'
51+
)->label( 'Link'
52+
)->label( 'setSizeLimit'
53+
)->input( value = client->_bind_edit( mv_set_size_limit )
54+
)->label( 'Number of Entries'
55+
)->input( value = client->_bind_edit( mv_combo_number )
56+
)->label( 'demo'
57+
)->combobox( items = client->_bind_local( lt_combo )
58+
)->item( key = '{KEY}' text = '{TEXT}'
59+
)->get_parent( )->get_parent(
60+
)->button(
61+
text = 'update'
62+
press = client->_event( val = 'UPDATE' )
63+
)->stringify( ) t_config = VALUE #( ( n = `setSizeLimit` v = mv_set_size_limit ) ) ).
64+
65+
ENDMETHOD.
66+
ENDCLASS.

src/z2ui5_cl_demo_app_071.clas.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
3+
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
4+
<asx:values>
5+
<VSEOCLASS>
6+
<CLSNAME>Z2UI5_CL_DEMO_APP_071</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>setSizeLimit</DESCRIPT>
9+
<STATE>1</STATE>
10+
<CLSCCINCL>X</CLSCCINCL>
11+
<FIXPT>X</FIXPT>
12+
<UNICODE>X</UNICODE>
13+
</VSEOCLASS>
14+
</asx:values>
15+
</asx:abap>
16+
</abapGit>

0 commit comments

Comments
 (0)