Skip to content

Commit aecbac1

Browse files
authored
add demo output
1 parent 1b9137e commit aecbac1

File tree

2 files changed

+99
-1
lines changed

2 files changed

+99
-1
lines changed

docs/.vitepress/config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ export default defineConfig({
160160
link: "/development/specific/geolocation",
161161
},
162162
{ text: "URL", link: "/development/specific/url" },
163-
{ text: "Formatter", link: "/development/specific/formatter" },
163+
{ text: "Formatter", link: "/development/specific/formatter" },
164+
{ text: "cl_demo_output", link: "/development/specific/demo_output" },
164165
],
165166
},
166167
],
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# cl_demo_output
2+
3+
You can also display the html output of the class cl_demo_output with abap2UI5. Take the following snippet ot see how it works:
4+
5+
```abap
6+
METHOD z2ui5_if_app~main.
7+
8+
DATA(lv_style) = `<html:style type="text/css">body {` && |\n| &&
9+
` font-family: Arial;` && |\n| &&
10+
` font-size: 90%;` && |\n| &&
11+
`}` && |\n| &&
12+
`table {` && |\n| &&
13+
` font-family: Arial;` && |\n| &&
14+
` font-size: 90%;` && |\n| &&
15+
`}` && |\n| &&
16+
`caption {` && |\n| &&
17+
` font-family: Arial;` && |\n| &&
18+
` font-size: 90%;` && |\n| &&
19+
` font-weight:bold;` && |\n| &&
20+
` text-align:left;` && |\n| &&
21+
`}` && |\n| &&
22+
`span.heading1 {` && |\n| &&
23+
` font-size: 150%;` && |\n| &&
24+
` color:#000080;` && |\n| &&
25+
` font-weight:bold;` && |\n| &&
26+
`}` && |\n| &&
27+
`span.heading2 {` && |\n| &&
28+
` font-size: 135%;` && |\n| &&
29+
` color:#000080;` && |\n| &&
30+
` font-weight:bold;` && |\n| &&
31+
`}` && |\n| &&
32+
`span.heading3 {` && |\n| &&
33+
` font-size: 120%;` && |\n| &&
34+
` color:#000080;` && |\n| &&
35+
` font-weight:bold;` && |\n| &&
36+
`}` && |\n| &&
37+
`span.heading4 {` && |\n| &&
38+
` font-size: 105%;` && |\n| &&
39+
` color:#000080;` && |\n| &&
40+
` font-weight:bold;` && |\n| &&
41+
`}` && |\n| &&
42+
`span.normal {` && |\n| &&
43+
` font-size: 100%;` && |\n| &&
44+
` color:#000000;` && |\n| &&
45+
` font-weight:normal;` && |\n| &&
46+
`}` && |\n| &&
47+
`span.nonprop {` && |\n| &&
48+
` font-family: Courier New;` && |\n| &&
49+
` font-size: 100%;` && |\n| &&
50+
` color:#000000;` && |\n| &&
51+
` font-weight:400;` && |\n| &&
52+
`}` && |\n| &&
53+
`span.nowrap {` && |\n| &&
54+
` white-space:nowrap;` && |\n| &&
55+
`}` && |\n| &&
56+
`span.nprpnwrp {` && |\n| &&
57+
` font-family: Courier New;` && |\n| &&
58+
` font-size: 100%;` && |\n| &&
59+
` color:#000000;` && |\n| &&
60+
` font-weight:400;` && |\n| &&
61+
` white-space:nowrap;` && |\n| &&
62+
`}` && |\n| &&
63+
`tr.header {` && |\n| &&
64+
` background-color:#D3D3D3;` && |\n| &&
65+
`}` && |\n| &&
66+
`tr.body {` && |\n| &&
67+
` background-color:#EFEFEF;` && |\n| &&
68+
`}` && |\n| &&
69+
`</html:style>`.
70+
71+
72+
73+
DATA(lv_html) = `` && |\n| &&
74+
|\n| &&
75+
`<h2 title="I'm a header">The title Attribute</h2>` && |\n| &&
76+
|\n| &&
77+
`<p title="I'm a tooltip">Mouse over this paragraph, to display the title attribute as a tooltip.</p>` && |\n| &&
78+
|\n| &&
79+
``.
80+
81+
* SELECT *from scarr
82+
* INTO TABLE @DATA(carriers).
83+
*
84+
* DATA(lv_html) = cl_demo_output=>get( carriers ).
85+
86+
DATA(view) = z2ui5_cl_xml_view=>factory( ).
87+
view->shell(
88+
)->page(
89+
)->button( text = `test`
90+
)->_cc_plain_xml( lv_style
91+
)->html( lv_html
92+
).
93+
94+
client->view_display( view->stringify( ) ).
95+
96+
ENDMETHOD.
97+
```

0 commit comments

Comments
 (0)