Skip to content

Commit fc2979b

Browse files
New Sample: HTML (#283)
1 parent c36d9e0 commit fc2979b

File tree

3 files changed

+132
-0
lines changed

3 files changed

+132
-0
lines changed

src/z2ui5_cl_demo_app_000.clas.abap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,13 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
475475
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
476476
).
477477

478+
panel->generic_tile(
479+
header = 'HTML'
480+
press = client->_event( 'Z2UI5_CL_DEMO_APP_242' )
481+
mode = 'LineMode'
482+
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
483+
).
484+
478485
panel = page->panel(
479486
expandable = abap_false
480487
expanded = abap_true
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
class z2ui5_cl_demo_app_242 definition
2+
public
3+
create public .
4+
5+
public section.
6+
7+
interfaces Z2UI5_IF_APP .
8+
9+
data CHECK_INITIALIZED type ABAP_BOOL .
10+
PROTECTED SECTION.
11+
12+
DATA client TYPE REF TO z2ui5_if_client.
13+
14+
METHODS display_view
15+
IMPORTING
16+
client TYPE REF TO z2ui5_if_client.
17+
METHODS on_event
18+
IMPORTING
19+
client TYPE REF TO z2ui5_if_client.
20+
METHODS z2ui5_display_popover
21+
IMPORTING
22+
id TYPE string.
23+
24+
PRIVATE SECTION.
25+
ENDCLASS.
26+
27+
28+
29+
CLASS z2ui5_cl_demo_app_242 IMPLEMENTATION.
30+
31+
32+
METHOD DISPLAY_VIEW.
33+
34+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
35+
)->page(
36+
title = 'abap2UI5 - Sample: HTML'
37+
navbuttonpress = client->_event( 'BACK' )
38+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).
39+
40+
page->header_content(
41+
)->button( id = `hint_icon`
42+
icon = `sap-icon://hint`
43+
tooltip = `Sample information`
44+
press = client->_event( 'POPOVER' ) ).
45+
46+
page->header_content(
47+
)->link(
48+
text = 'UI5 Demo Kit'
49+
target = '_blank'
50+
href = 'https://sapui5.hana.ondemand.com/sdk/#/entity/sap.ui.core.HTML/sample/sap.ui.core.sample.Html' ).
51+
52+
53+
DATA(layout) = page->vertical_layout(
54+
class = `sapUiContentPadding`
55+
width = `100%`
56+
)->content( ns = `layout`
57+
)->html( content = `<div class="content"><h4>Lorem ipsum</h4><div>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, ` &&
58+
`sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ` &&
59+
`At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ` &&
60+
`Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ` &&
61+
`At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</div><a ` &&
62+
`target="_blank" href="http://en.wikipedia.org/wiki/Lorem_ipsum">Learn more about Lorem Ipsum ...</a></div>`
63+
).
64+
client->view_display( page->stringify( ) ).
65+
66+
ENDMETHOD.
67+
68+
69+
METHOD ON_EVENT.
70+
71+
CASE client->get( )-event.
72+
WHEN 'BACK'.
73+
client->nav_app_leave( ).
74+
WHEN 'POPOVER'.
75+
z2ui5_display_popover( `hint_icon` ).
76+
ENDCASE.
77+
78+
ENDMETHOD.
79+
80+
81+
METHOD Z2UI5_DISPLAY_POPOVER.
82+
83+
DATA(view) = z2ui5_cl_xml_view=>factory_popup( ).
84+
view->quick_view( placement = `Bottom` width = `auto`
85+
)->quick_view_page( pageid = `sampleInformationId`
86+
header = `Sample information`
87+
description = `With the HTML controls you can easily embed any kind of HTML content into your UI5 mobile application.` ).
88+
89+
client->popover_display(
90+
xml = view->stringify( )
91+
by_id = id
92+
).
93+
94+
ENDMETHOD.
95+
96+
97+
METHOD Z2UI5_IF_APP~MAIN.
98+
99+
me->client = client.
100+
101+
IF check_initialized = abap_false.
102+
check_initialized = abap_true.
103+
display_view( client ).
104+
ENDIF.
105+
106+
on_event( client ).
107+
108+
ENDMETHOD.
109+
ENDCLASS.

src/z2ui5_cl_demo_app_242.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_242</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>HTML</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)