Skip to content

Commit 771389e

Browse files
authored
Merge pull request #84 from abap2UI5/claude/keyboard-clipboard-ui-Y5gVA
docs(cookbook): swap Soft Keyboard and Clipboard between sidebar groups
2 parents dd951d3 + 8924bef commit 771389e

2 files changed

Lines changed: 69 additions & 3 deletions

File tree

docs/.vitepress/config.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ export default defineConfig({
183183
text: "Geolocation",
184184
link: "/development/specific/geolocation",
185185
},
186-
{ text: "Clipboard", link: "/development/specific/clipboard" },
186+
{ text: "Soft Keyboard", link: "/development/specific/soft_keyboard" },
187+
{ text: "Frontend Info", link: "/development/specific/frontend_info" },
187188
{
188189
text: "Upload, Download",
189190
link: "/development/specific/files",
@@ -195,13 +196,13 @@ export default defineConfig({
195196
],
196197
},
197198
{
198-
text: "UI Interaction",
199+
text: "Browser Interaction",
199200
link: "/development/specific/focus",
200201
collapsed: true,
201202
items: [
202203
{ text: "Focus", link: "/development/specific/focus" },
203204
{ text: "Scrolling", link: "/development/specific/scrolling" },
204-
{ text: "Soft Keyboard", link: "/development/specific/soft_keyboard" },
205+
{ text: "Clipboard", link: "/development/specific/clipboard" },
205206
{ text: "Title", link: "/development/specific/title" },
206207
{ text: "Timer", link: "/development/specific/timer" },
207208
{ text: "URL Handling", link: "/development/specific/url" },
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
outline: [2, 4]
3+
---
4+
# Frontend Info
5+
6+
abap2UI5 offers a custom control for reading all frontend information from the user's device — UI5 version and theme, browser, operating system, system type, screen dimensions, and device class (phone, tablet, desktop). This is handy whenever your ABAP logic needs to adapt to the runtime environment.
7+
8+
The control collects the values on the frontend and returns them via two-way binding. Once the `finished` event fires, all bound attributes are filled and available to ABAP. See also `Z2UI5_CL_DEMO_APP_122`.
9+
10+
```abap
11+
CLASS z2ui5_cl_sample_frontend_info DEFINITION PUBLIC.
12+
13+
PUBLIC SECTION.
14+
INTERFACES z2ui5_if_app.
15+
16+
DATA ui5_version TYPE string.
17+
DATA ui5_theme TYPE string.
18+
DATA ui5_gav TYPE string.
19+
DATA device_systemtype TYPE string.
20+
DATA device_os TYPE string.
21+
DATA device_browser TYPE string.
22+
DATA device_phone TYPE abap_bool.
23+
DATA device_desktop TYPE abap_bool.
24+
DATA device_tablet TYPE abap_bool.
25+
DATA device_combi TYPE abap_bool.
26+
DATA device_height TYPE string.
27+
DATA device_width TYPE string.
28+
29+
ENDCLASS.
30+
31+
CLASS z2ui5_cl_sample_frontend_info IMPLEMENTATION.
32+
33+
METHOD z2ui5_if_app~main.
34+
35+
DATA(view) = z2ui5_cl_xml_view=>factory( ).
36+
client->view_display( view->shell(
37+
)->page( )->_z2ui5(
38+
)->info_frontend(
39+
finished = client->_event( `POST` )
40+
device_browser = client->_bind_edit( device_browser )
41+
device_os = client->_bind_edit( device_os )
42+
device_systemtype = client->_bind_edit( device_systemtype )
43+
ui5_gav = client->_bind_edit( ui5_gav )
44+
ui5_theme = client->_bind_edit( ui5_theme )
45+
ui5_version = client->_bind_edit( ui5_version )
46+
device_phone = client->_bind_edit( device_phone )
47+
device_desktop = client->_bind_edit( device_desktop )
48+
device_tablet = client->_bind_edit( device_tablet )
49+
device_combi = client->_bind_edit( device_combi )
50+
device_height = client->_bind_edit( device_height )
51+
device_width = client->_bind_edit( device_width )
52+
)->stringify( ) ).
53+
54+
CASE client->get( )-event.
55+
WHEN `POST`.
56+
"process frontend info here...
57+
ENDCASE.
58+
59+
ENDMETHOD.
60+
ENDCLASS.
61+
```
62+
63+
::: tip **Bind Directly in the View**
64+
If you only need device information in the view (not in ABAP logic), bind to the built-in UI5 device model via `{device>/...}` instead — no backend roundtrip required. See [Device Model](../model/device.md).
65+
:::

0 commit comments

Comments
 (0)