Skip to content

Commit 47c9eeb

Browse files
authored
Working shell bar with title mega menu sample (#321)
1 parent 9bcd4f3 commit 47c9eeb

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

src/z2ui5_cl_demo_app_000.clas.abap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
12681268

12691269
panel->generic_tile(
12701270
header = 'Shell Bar'
1271-
* subheader = '7 Areas'
1271+
subheader = 'title mega menu'
12721272
press = client->_event( 'Z2UI5_CL_DEMO_APP_269' )
12731273
mode = 'LineMode'
12741274
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'

src/z2ui5_cl_demo_app_269.clas.abap

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,42 @@ CLASS z2ui5_cl_demo_app_269 DEFINITION
44

55
PUBLIC SECTION.
66
INTERFACES z2ui5_if_app.
7+
8+
PROTECTED SECTION.
9+
DATA check_initialized TYPE abap_bool.
10+
11+
METHODS display_view.
12+
METHODS on_event.
13+
14+
DATA client TYPE REF TO z2ui5_if_client.
715
ENDCLASS.
816

917

1018
CLASS z2ui5_cl_demo_app_269 IMPLEMENTATION.
1119
METHOD z2ui5_if_app~main.
12-
DATA(view) = z2ui5_cl_xml_view=>factory( ).
20+
me->client = client.
21+
22+
IF check_initialized = abap_false.
23+
check_initialized = abap_true.
24+
display_view( ).
25+
ENDIF.
26+
27+
on_event( ).
28+
ENDMETHOD.
29+
30+
METHOD display_view.
31+
32+
DATA(view) = z2ui5_cl_xml_view=>factory( ).
1333

1434
view->shell_bar(
15-
title = `Application Title`
16-
secondTitle = `Short description`
35+
title = `Shell Bar`
36+
secondTitle = `with title mega menu`
1737
homeIcon = `https://sapui5.hana.ondemand.com/sdk/resources/sap/ui/documentation/sdk/images/logo_sap.png`
18-
showCopilot = abap_true
38+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
1939
showSearch = abap_true
2040
showNotifications = abap_true
2141
notificationsNumber = `2`
42+
navbuttonpressed = client->_event( 'BACK' )
2243
)->_generic( name = `menu`
2344
ns = `f`
2445
)->_generic( name = `Menu`
@@ -30,10 +51,19 @@ CLASS z2ui5_cl_demo_app_269 IMPLEMENTATION.
3051
)->get_parent(
3152
)->_generic( name = `profile`
3253
ns = `f`
33-
)->avatar( initials = 'UI' ).
54+
)->avatar( ns = `f`
55+
initials = 'UI' ).
3456

3557
DATA(xml) = view->stringify( ).
3658

3759
client->view_display( xml ).
60+
61+
ENDMETHOD.
62+
63+
METHOD on_event.
64+
CASE client->get( )-event.
65+
WHEN 'BACK'.
66+
client->nav_app_leave( ).
67+
ENDCASE.
3868
ENDMETHOD.
3969
ENDCLASS.

0 commit comments

Comments
 (0)