Skip to content

Commit 55928c8

Browse files
authored
Merge pull request #87 from abap2UI5/claude/elegant-knuth-BKmIf
Reorganize documentation: move browser interaction and device features to cookbook
2 parents bba32dd + 7e7f9b7 commit 55928c8

62 files changed

Lines changed: 450 additions & 517 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/.vitepress/config.mjs

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default defineConfig({
6060
text: "Guide",
6161
items: [
6262
{ text: "Introduction", link: "/get_started/about" },
63-
{ text: "Cookbook", link: "/development/controller/life_cycle" },
63+
{ text: "Cookbook", link: "/cookbook/event_navigation/life_cycle" },
6464
{ text: "Configuration", link: "/configuration/setup" },
6565
{ text: "Advanced Topic", link: "/advanced/downporting" },
6666
{ text: "Technical Insight", link: "/technical/concept" },
@@ -114,148 +114,148 @@ export default defineConfig({
114114
},
115115
{
116116
text: "Cookbook",
117-
link: "/development/controller/life_cycle",
117+
link: "/cookbook/event_navigation/life_cycle",
118118
collapsed: true,
119119
items: [
120120
{
121121
text: "View",
122-
link: "/development/view/overview",
122+
link: "/cookbook/view/overview",
123123
collapsed: true,
124124
items: [
125-
{ text: "Overview", link: "/development/view/overview" },
126-
{ text: "Definition", link: "/development/view/definition" },
127-
{ text: "Nested Views", link: "/development/view/nested" },
128-
{ text: "XML Templating", link: "/development/specific/xml_templating" },
125+
{ text: "Overview", link: "/cookbook/view/overview" },
126+
{ text: "Definition", link: "/cookbook/view/definition" },
127+
{ text: "Nested Views", link: "/cookbook/view/nested_views" },
128+
{ text: "XML Templating", link: "/cookbook/view/xml_templating" },
129129
],
130130
},
131131
{
132132
text: "Model",
133-
link: "/development/model/binding",
133+
link: "/cookbook/model/binding",
134134
collapsed: true,
135135
items: [
136136
{
137137
text: "Binding",
138-
link: "/development/model/binding",
138+
link: "/cookbook/model/binding",
139139
items: [
140-
{ text: "Expression Binding", link: "/development/model/expression_binding" },
141-
{ text: "Formatter", link: "/development/specific/formatter" },
140+
{ text: "Expression Binding", link: "/cookbook/model/expression_binding" },
141+
{ text: "Formatter", link: "/cookbook/model/formatter" },
142142
],
143143
},
144-
{ text: "Tables", link: "/development/model/tables" },
145-
{ text: "Trees", link: "/development/model/trees" },
146-
{ text: "Device Model", link: "/development/model/device" },
147-
{ text: "Size Limit", link: "/development/model/size_limit" },
144+
{ text: "Tables", link: "/cookbook/model/tables" },
145+
{ text: "Trees", link: "/cookbook/model/trees" },
146+
{ text: "Device Model", link: "/cookbook/model/device_model" },
147+
{ text: "Size Limit", link: "/cookbook/model/size_limit" },
148148
],
149149
},
150150
{
151151
text: "Event, Navigation",
152-
link: "/development/controller/life_cycle",
152+
link: "/cookbook/event_navigation/life_cycle",
153153
collapsed: true,
154154
items: [
155-
{ text: "Life Cycle", link: "/development/controller/life_cycle" },
155+
{ text: "Life Cycle", link: "/cookbook/event_navigation/life_cycle" },
156156
{
157157
text: "Event",
158-
link: "/development/events/backend",
158+
link: "/cookbook/event_navigation/backend",
159159
items: [
160-
{ text: "Backend", link: "/development/events/backend" },
161-
{ text: "Frontend", link: "/development/events/frontend" },
160+
{ text: "Backend", link: "/cookbook/event_navigation/backend" },
161+
{ text: "Frontend", link: "/cookbook/event_navigation/frontend" },
162162
],
163163
},
164-
{ text: "Action", link: "/development/events/follow_up" },
165-
{ text: "Navigation", link: "/development/navigation/inner_cross_app" },
166-
{ text: "Exception", link: "/development/messages/errors" },
164+
{ text: "Action", link: "/cookbook/event_navigation/action" },
165+
{ text: "Navigation", link: "/cookbook/event_navigation/navigation" },
166+
{ text: "Exception", link: "/cookbook/event_navigation/exception" },
167167
],
168168
},
169169
{
170170
text: "Popup, Popover",
171-
link: "/development/popups/popup",
171+
link: "/cookbook/popup_popover/popup",
172172
collapsed: true,
173173
items: [
174-
{ text: "Popup", link: "/development/popups/popup" },
175-
{ text: "Popover", link: "/development/popups/popover" },
176-
{ text: "Built-In", link: "/development/popups/built_in" },
174+
{ text: "Popup", link: "/cookbook/popup_popover/popup" },
175+
{ text: "Popover", link: "/cookbook/popup_popover/popover" },
176+
{ text: "Built-In", link: "/cookbook/popup_popover/built_in" },
177177
],
178178
},
179179
{
180180
text: "Device Capabilities",
181-
link: "/development/specific/info",
181+
link: "/cookbook/device_capabilities/info",
182182
collapsed: true,
183183
items: [
184-
{ text: "Info", link: "/development/specific/info" },
185-
{ text: "Camera", link: "/development/specific/camera" },
184+
{ text: "Info", link: "/cookbook/device_capabilities/info" },
185+
{ text: "Camera", link: "/cookbook/device_capabilities/camera" },
186186
{
187187
text: "Geolocation",
188-
link: "/development/specific/geolocation",
188+
link: "/cookbook/device_capabilities/geolocation",
189189
},
190-
{ text: "Soft Keyboard", link: "/development/specific/soft_keyboard" },
190+
{ text: "Soft Keyboard", link: "/cookbook/device_capabilities/soft_keyboard" },
191191
{
192192
text: "Barcode Scanning",
193-
link: "/development/specific/barcodes",
193+
link: "/cookbook/device_capabilities/barcode_scanning",
194194
},
195195
{
196196
text: "Upload, Download",
197-
link: "/development/specific/files",
197+
link: "/cookbook/device_capabilities/upload_download",
198198
items: [
199-
{ text: "PDF", link: "/development/specific/pdf" },
200-
{ text: "Spreadsheet", link: "/development/specific/xlsx" },
199+
{ text: "PDF", link: "/cookbook/device_capabilities/pdf" },
200+
{ text: "Spreadsheet", link: "/cookbook/device_capabilities/spreadsheet" },
201201
],
202202
},
203203
],
204204
},
205205
{
206206
text: "Browser Interaction",
207-
link: "/development/specific/title",
207+
link: "/cookbook/browser_interaction/title",
208208
collapsed: true,
209209
items: [
210-
{ text: "Title", link: "/development/specific/title" },
211-
{ text: "Focus", link: "/development/specific/focus" },
212-
{ text: "Scrolling", link: "/development/specific/scrolling" },
213-
{ text: "Timer", link: "/development/specific/timer" },
214-
{ text: "Clipboard", link: "/development/specific/clipboard" },
215-
{ text: "URL Handling", link: "/development/specific/url" },
210+
{ text: "Title", link: "/cookbook/browser_interaction/title" },
211+
{ text: "Focus", link: "/cookbook/browser_interaction/focus" },
212+
{ text: "Scrolling", link: "/cookbook/browser_interaction/scrolling" },
213+
{ text: "Timer", link: "/cookbook/browser_interaction/timer" },
214+
{ text: "Clipboard", link: "/cookbook/browser_interaction/clipboard" },
215+
{ text: "URL Handling", link: "/cookbook/browser_interaction/url_handling" },
216216
],
217217
},
218218
{
219219
text: "Translation, Messages",
220-
link: "/development/messages/messages",
220+
link: "/cookbook/translation_messages/message",
221221
collapsed: true,
222222
items: [
223-
{ text: "Message", link: "/development/messages/messages" },
224-
{ text: "Logging", link: "/development/messages/logging" },
225-
{ text: "Translation, i18n", link: "/development/translation" },
223+
{ text: "Message", link: "/cookbook/translation_messages/message" },
224+
{ text: "Logging", link: "/cookbook/translation_messages/logging" },
225+
{ text: "Translation, i18n", link: "/cookbook/translation_messages/translation_i18n" },
226226
],
227227
},
228228
{
229229
text: "EML, CDS, SQL",
230-
link: "/development/specific/rap",
230+
link: "/cookbook/eml_cds_sql/rap",
231231
collapsed: true,
232232
items: [
233-
{ text: "RAP", link: "/development/specific/rap" },
234-
{ text: "EML", link: "/development/specific/eml" },
235-
{ text: "Draft Handling", link: "/development/specific/draft" },
236-
{ text: "CDS", link: "/development/specific/cds" },
237-
{ text: "ABAP SQL", link: "/development/specific/abap_sql" },
238-
{ text: "Fuzzy Search", link: "/development/specific/fuzzy_search" },
233+
{ text: "RAP", link: "/cookbook/eml_cds_sql/rap" },
234+
{ text: "EML", link: "/cookbook/eml_cds_sql/eml" },
235+
{ text: "Draft Handling", link: "/cookbook/eml_cds_sql/draft_handling" },
236+
{ text: "CDS", link: "/cookbook/eml_cds_sql/cds" },
237+
{ text: "ABAP SQL", link: "/cookbook/eml_cds_sql/abap_sql" },
238+
{ text: "Fuzzy Search", link: "/cookbook/eml_cds_sql/fuzzy_search" },
239239
],
240240
},
241241
{
242242
text: "Expert, More",
243-
link: "/development/specific/locks",
243+
link: "/cookbook/expert_more/lock",
244244
collapsed: true,
245245
items: [
246-
{ text: "Lock", link: "/development/specific/locks" },
247-
{ text: "Statefulness", link: "/development/specific/statefulness" },
248-
{ text: "WebSocket", link: "/development/specific/websocket" },
246+
{ text: "Lock", link: "/cookbook/expert_more/lock" },
247+
{ text: "Statefulness", link: "/cookbook/expert_more/statefulness" },
248+
{ text: "WebSocket", link: "/cookbook/expert_more/websocket" },
249249
{ text: "Logout", link: "/configuration/logout" },
250-
{ text: "OData", link: "/development/model/odata" },
251-
{ text: "App State, Share", link: "/development/navigation/app_state" },
250+
{ text: "OData", link: "/cookbook/expert_more/odata" },
251+
{ text: "App State, Share", link: "/cookbook/expert_more/app_state_share" },
252252
{
253253
text: "Utilities",
254254
collapsed: false,
255255
items: [
256-
{ text: "Value Help", link: "/development/specific/value_help" },
257-
{ text: "Demo Output", link: "/development/specific/demo_output" },
258-
{ text: "E-Mail", link: "/development/specific/email" },
256+
{ text: "Value Help", link: "/cookbook/expert_more/value_help" },
257+
{ text: "Demo Output", link: "/cookbook/expert_more/demo_output" },
258+
{ text: "E-Mail", link: "/cookbook/expert_more/email" },
259259
],
260260
},
261261
],
@@ -324,10 +324,10 @@ export default defineConfig({
324324
text: "Experimental",
325325
collapsed: true,
326326
items: [
327-
{ text: "Drag & Drop", link: "/development/specific/drag" },
327+
{ text: "Drag & Drop", link: "/advanced/experimental/drag_drop" },
328328
{
329329
text: "Smart Control",
330-
link: "/development/specific/smart_controls",
330+
link: "/advanced/experimental/smart_control",
331331
},
332332
],
333333
},

docs/development/specific/smart_controls.md renamed to docs/advanced/experimental/smart_control.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
outline: [2, 4]
33
---
4-
# Smart Controls
4+
# Smart Control
55

66
Smart Controls are metadata-driven UI5 controls that build the UI automatically from OData annotations. abap2UI5 supports them on an experimental basis.
77

docs/advanced/extensibility/custom_js.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ outline: [2, 4]
33
---
44
# Custom JS
55

6-
If the standard UI5 framework doesn't cover all your needs, define and call your own JavaScript functions. [Barcode Scanning](/development/specific/barcodes), for example, uses this approach to play a sound after a scan.
6+
If the standard UI5 framework doesn't cover all your needs, define and call your own JavaScript functions. [Barcode Scanning](/cookbook/device_capabilities/barcode_scanning), for example, uses this approach to play a sound after a scan.
77

88
The idea: send the JavaScript function with the view to the frontend, then call it later when an event fires.
99

docs/development/specific/clipboard.md renamed to docs/cookbook/browser_interaction/clipboard.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ CLASS z2ui5_cl_sample_clipboard IMPLEMENTATION.
3131
)->stringify( ) ).
3232
3333
WHEN client->check_on_event( `COPY` ).
34-
client->follow_up_action( client->_event_client(
34+
client->action(
3535
val = client->cs_event-clipboard_copy
36-
t_arg = VALUE #( ( mv_text ) ) ) ).
36+
t_arg = VALUE #( ( mv_text ) ) ).
3737
client->message_toast_display( `copied` ).
3838
3939
ENDCASE.
@@ -44,7 +44,7 @@ ENDCLASS.
4444

4545
#### Copy the App State URL
4646

47-
To share the current app state instead of a custom string, use `clipboard_app_state` — see [App State, Share, Bookmark](../navigation/app_state.md).
47+
To share the current app state instead of a custom string, use `clipboard_app_state` — see [App State, Share, Bookmark](../expert_more/app_state_share.md).
4848

4949
::: warning
5050
The browser's Clipboard API requires HTTPS (or `localhost`). On plain HTTP the call is silently ignored.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
outline: [2, 4]
3+
---
4+
# Focus
5+
6+
Set the input focus from the backend with the `set_focus` frontend event. Pass the target control's `id` as the first argument — the framework moves the cursor to that field after the next roundtrip.
7+
8+
This is useful for guided data entry, barcode scanning, or any flow where the next field to focus depends on backend logic.
9+
10+
#### Basic Usage
11+
12+
After processing an event, call `client->action( )` with `cs_event-set_focus` and the id of the input to focus next:
13+
14+
```abap
15+
CLASS z2ui5_cl_sample_focus DEFINITION PUBLIC.
16+
17+
PUBLIC SECTION.
18+
INTERFACES z2ui5_if_app.
19+
DATA one TYPE string.
20+
DATA two TYPE string.
21+
22+
ENDCLASS.
23+
24+
CLASS z2ui5_cl_sample_focus IMPLEMENTATION.
25+
METHOD z2ui5_if_app~main.
26+
27+
IF client->check_on_init( ).
28+
29+
DATA(page) = z2ui5_cl_xml_view=>factory( )->page( ).
30+
page->simple_form(
31+
)->content( ns = `form`
32+
)->label( `One`
33+
)->input(
34+
id = `id1`
35+
value = client->_bind_edit( one )
36+
submit = client->_event( `ONE_ENTER` )
37+
)->label( `Two`
38+
)->input(
39+
id = `id2`
40+
value = client->_bind_edit( two )
41+
submit = client->_event( `TWO_ENTER` ) ).
42+
43+
client->view_display( page->stringify( ) ).
44+
RETURN.
45+
ENDIF.
46+
47+
CASE client->get( )-event.
48+
WHEN `ONE_ENTER`.
49+
client->action( val = client->cs_event-set_focus
50+
t_arg = VALUE #( ( `id2` ) ) ).
51+
WHEN `TWO_ENTER`.
52+
client->action( val = client->cs_event-set_focus
53+
t_arg = VALUE #( ( `id1` ) ) ).
54+
ENDCASE.
55+
56+
ENDMETHOD.
57+
ENDCLASS.
58+
```
59+
60+
After the user presses Enter in `id1`, the backend fires `set_focus` for `id2` and the cursor moves to the second input. The same pattern works for any chain of fields.
61+
62+
#### Selection Range
63+
64+
To position the caret inside the field or pre-select a range, pass the start and end offsets as additional arguments:
65+
66+
```abap
67+
client->action( val = client->cs_event-set_focus
68+
t_arg = VALUE #( ( `id1` ) ( `0` ) ( `5` ) ) ).
69+
```
70+
71+
#### Barcode Scanning
72+
73+
Most barcode scanner devices emulate a keyboard. Combine `set_focus` with input fields to capture scans into the right field automatically — see [Barcode Scanning](../device_capabilities/barcode_scanning.md) for a full walkthrough.

0 commit comments

Comments
 (0)