Skip to content

Commit 575942a

Browse files
New Demo: Input Types (#242)
* New Demo: Input Types * New Demo: Input Types (2)
1 parent 8b7360c commit 575942a

File tree

3 files changed

+116
-0
lines changed

3 files changed

+116
-0
lines changed

src/z2ui5_cl_demo_app_000.clas.abap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,14 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
370370
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
371371
).
372372

373+
panel->generic_tile(
374+
header = 'Input'
375+
subheader = 'Types'
376+
press = client->_event( 'Z2UI5_CL_DEMO_APP_210' )
377+
mode = 'LineMode'
378+
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
379+
).
380+
373381
panel = page->panel(
374382
expandable = abap_false
375383
expanded = abap_true
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
class Z2UI5_CL_DEMO_APP_210 definition
2+
public
3+
create public .
4+
5+
public section.
6+
7+
interfaces IF_SERIALIZABLE_OBJECT .
8+
interfaces Z2UI5_IF_APP .
9+
10+
data CHECK_INITIALIZED type ABAP_BOOL .
11+
PROTECTED SECTION.
12+
13+
METHODS display_view
14+
IMPORTING
15+
client TYPE REF TO z2ui5_if_client.
16+
METHODS on_event
17+
IMPORTING
18+
client TYPE REF TO z2ui5_if_client.
19+
20+
PRIVATE SECTION.
21+
ENDCLASS.
22+
23+
24+
25+
CLASS Z2UI5_CL_DEMO_APP_210 IMPLEMENTATION.
26+
27+
28+
METHOD DISPLAY_VIEW.
29+
30+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
31+
)->page(
32+
title = 'abap2UI5 - Sample: Input - Types'
33+
navbuttonpress = client->_event( 'BACK' )
34+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).
35+
36+
DATA(layout) = page->vertical_layout( class = `sapUiContentPadding` width = `100%` ).
37+
38+
layout->label( text = `Text` labelfor = `inputText` ).
39+
layout->input( id = `inputText`
40+
placeholder = `Enter text`
41+
class = `sapUiSmallMarginBottom` ).
42+
43+
layout->label( text = `Email` labelfor = `inputEmail` ).
44+
layout->input( id = `inputEmail`
45+
type = `Email`
46+
placeholder = `Enter email`
47+
class = `sapUiSmallMarginBottom` ).
48+
49+
layout->label( text = `Telephone` labelfor = `inputTel` ).
50+
layout->input( id = `inputTel`
51+
type = `Tel`
52+
placeholder = `Enter telephone number`
53+
class = `sapUiSmallMarginBottom` ).
54+
55+
layout->label( text = `Number` labelfor = `inputNumber` ).
56+
layout->input( id = `inputNumber`
57+
type = `Number`
58+
placeholder = `Enter a number`
59+
class = `sapUiSmallMarginBottom` ).
60+
61+
layout->label( text = `URL` labelfor = `inputUrl` ).
62+
layout->input( id = `inputUrl`
63+
type = `Url`
64+
placeholder = `Enter URL`
65+
class = `sapUiSmallMarginBottom` ).
66+
67+
client->view_display( page->stringify( ) ).
68+
69+
ENDMETHOD.
70+
71+
72+
METHOD ON_EVENT.
73+
74+
CASE client->get( )-event.
75+
WHEN 'BACK'.
76+
client->nav_app_leave( ).
77+
ENDCASE.
78+
79+
ENDMETHOD.
80+
81+
82+
METHOD Z2UI5_IF_APP~MAIN.
83+
84+
IF check_initialized = abap_false.
85+
check_initialized = abap_true.
86+
display_view( client ).
87+
ENDIF.
88+
89+
on_event( client ).
90+
91+
ENDMETHOD.
92+
ENDCLASS.

src/z2ui5_cl_demo_app_210.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_210</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>Input - Types</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)