Skip to content

Commit a1593b2

Browse files
New Sample: Icon Tab Bar - Sub tabs (#262)
1 parent ce6999c commit a1593b2

File tree

3 files changed

+156
-0
lines changed

3 files changed

+156
-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
@@ -918,6 +918,14 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
918918
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
919919
).
920920

921+
panel->generic_tile(
922+
header = 'Icon Tab Bar'
923+
subheader = 'Sub tabs'
924+
press = client->_event( 'Z2UI5_CL_DEMO_APP_226' )
925+
mode = 'LineMode'
926+
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
927+
).
928+
921929
panel = page->panel(
922930
expandable = abap_false
923931
expanded = abap_true
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
class z2ui5_cl_demo_app_226 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_226 IMPLEMENTATION.
26+
27+
28+
METHOD DISPLAY_VIEW.
29+
30+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
31+
)->page(
32+
title = 'abap2UI5 - Sample: Icon Tab Bar - Sub tabs'
33+
navbuttonpress = client->_event( 'BACK' )
34+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).
35+
36+
DATA(layout) = page->label(
37+
wrapping = `true`
38+
text = `IconTabBar with filters with own content and sub tabs. The click area is split to allow the user to display the content or alternatively to expand/collapse the sub tabs.`
39+
class = `sapUiSmallMargin` ).
40+
41+
layout->icon_tab_bar( class = `sapUiResponsiveContentPadding`
42+
)->items(
43+
)->icon_tab_filter( key = `info` text = `Info`
44+
)->items(
45+
)->icon_tab_filter( text = `Info one`
46+
)->text( text = `Info one content goes here...`
47+
)->text( text = `Select another sub tab to see its content...` )->get_parent(
48+
)->icon_tab_filter( text = `Info two`
49+
)->text( text = `Info two content goes here...` )->get_parent(
50+
)->icon_tab_filter( text = `Info three`
51+
)->text( text = `Info three content goes here...` )->get_parent(
52+
)->icon_tab_filter( text = `Info four`
53+
)->text( text = `Info four content goes here...` )->get_parent( )->get_parent(
54+
)->text( text = `Info own content goes here...`
55+
)->text( text = `Select a sub tab to see its content...` )->get_parent(
56+
57+
)->icon_tab_filter( key = `attachments` text = `Attachments`
58+
)->items(
59+
)->icon_tab_filter( text = `Attachment one`
60+
)->text( text = `Attachment one goes here...` )->get_parent(
61+
)->icon_tab_filter( text = `Attachment two`
62+
)->text( text = `Attachment two goes here...` )->get_parent( )->get_parent(
63+
)->text( text = `Attachments own content goes here...` )->get_parent(
64+
65+
)->icon_tab_filter( key = `notes` text = `Notes`
66+
)->items(
67+
)->icon_tab_filter( text = `Note one`
68+
)->text( text = `Note one goes here...` )->get_parent(
69+
)->icon_tab_filter( text = `Note two`
70+
)->text( text = `Note two goes here...` )->get_parent( )->get_parent(
71+
)->text( text = `Notes own content goes here...` )->get_parent( )->get_parent( )->get_parent(
72+
73+
)->label(
74+
wrapping = `true`
75+
text = `IconTabBar with filters without own content - only sub tabs`
76+
class = `sapUiSmallMargin`
77+
78+
79+
)->icon_tab_bar( class = `sapUiResponsiveContentPadding`
80+
)->items(
81+
)->icon_tab_filter( key = `info` text = `Info`
82+
)->items(
83+
)->icon_tab_filter( text = `Info one`
84+
)->text( text = `Info one content goes here...` )->get_parent(
85+
)->icon_tab_filter( text = `Info two`
86+
)->text( text = `Info two content goes here...` )->get_parent(
87+
)->icon_tab_filter( text = `Info three`
88+
)->text( text = `Info three content goes here...` )->get_parent(
89+
)->icon_tab_filter( text = `Info four`
90+
)->text( text = `Info four content goes here...` )->get_parent( )->get_parent( )->get_parent(
91+
92+
)->icon_tab_filter( key = `attachments` text = `Attachments`
93+
)->items(
94+
)->icon_tab_filter( text = `Attachment one`
95+
)->text( text = `Attachment one goes here...` )->get_parent(
96+
)->icon_tab_filter( text = `Attachment two`
97+
)->text( text = `Attachment two goes here...` )->get_parent( )->get_parent( )->get_parent(
98+
99+
)->icon_tab_filter( key = `notes` text = `Notes`
100+
)->items(
101+
)->icon_tab_filter( text = `Note one`
102+
)->text( text = `Note one content goes here...` )->get_parent(
103+
)->icon_tab_filter( text = `Note two`
104+
)->text( text = `Note two content goes here...` )->get_parent( )->get_parent(
105+
).
106+
107+
client->view_display( page->stringify( ) ).
108+
109+
ENDMETHOD.
110+
111+
112+
METHOD ON_EVENT.
113+
114+
CASE client->get( )-event.
115+
WHEN 'BACK'.
116+
client->nav_app_leave( ).
117+
ENDCASE.
118+
119+
ENDMETHOD.
120+
121+
122+
METHOD Z2UI5_IF_APP~MAIN.
123+
124+
IF check_initialized = abap_false.
125+
check_initialized = abap_true.
126+
display_view( client ).
127+
ENDIF.
128+
129+
on_event( client ).
130+
131+
ENDMETHOD.
132+
ENDCLASS.

src/z2ui5_cl_demo_app_226.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_226</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>Icon Tab Bar - Sub tabs</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)