Skip to content

Commit dd951d3

Browse files
authored
Merge pull request #83 from abap2UI5/claude/message-error-sidebar-category-TWXV0
docs(cookbook): restore Message, Error as own sidebar category below UI Interaction
2 parents 4b1df13 + 585f74c commit dd951d3

9 files changed

Lines changed: 52 additions & 160 deletions

File tree

docs/.vitepress/config.mjs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,6 @@ export default defineConfig({
117117
link: "/development/controller/life_cycle",
118118
collapsed: true,
119119
items: [
120-
{
121-
text: "Controller",
122-
link: "/development/controller/life_cycle",
123-
collapsed: true,
124-
items: [
125-
{ text: "Life Cycle", link: "/development/controller/life_cycle" },
126-
{ text: "Init", link: "/development/controller/init" },
127-
{ text: "Event", link: "/development/controller/event" },
128-
{ text: "Navigated", link: "/development/controller/navigated" },
129-
],
130-
},
131120
{
132121
text: "View",
133122
link: "/development/view/overview",
@@ -160,9 +149,10 @@ export default defineConfig({
160149
},
161150
{
162151
text: "Event, Navigation",
163-
link: "/development/events/backend",
152+
link: "/development/controller/life_cycle",
164153
collapsed: true,
165154
items: [
155+
{ text: "Life Cycle", link: "/development/controller/life_cycle" },
166156
{ text: "Backend", link: "/development/events/backend" },
167157
{ text: "Frontend", link: "/development/events/frontend" },
168158
{ text: "Follow-up", link: "/development/events/follow_up" },
@@ -215,6 +205,13 @@ export default defineConfig({
215205
{ text: "Title", link: "/development/specific/title" },
216206
{ text: "Timer", link: "/development/specific/timer" },
217207
{ text: "URL Handling", link: "/development/specific/url" },
208+
],
209+
},
210+
{
211+
text: "Message, Error",
212+
link: "/development/messages/messages",
213+
collapsed: true,
214+
items: [
218215
{ text: "Message", link: "/development/messages/messages" },
219216
{ text: "Error", link: "/development/messages/errors" },
220217
{ text: "Logging", link: "/development/messages/logging" },
@@ -244,11 +241,10 @@ export default defineConfig({
244241
{ text: "WebSocket", link: "/development/specific/websocket" },
245242
{ text: "Logout", link: "/configuration/logout" },
246243
{ text: "OData", link: "/development/model/odata" },
247-
{ text: "App State", link: "/development/navigation/app_state" },
248-
{ text: "Share, Bookmark", link: "/development/navigation/share" },
244+
{ text: "App State, Share, Bookmark", link: "/development/navigation/app_state" },
249245
{
250246
text: "Utilities",
251-
collapsed: true,
247+
collapsed: false,
252248
items: [
253249
{ text: "Value Help", link: "/development/specific/value_help" },
254250
{ text: "Demo Output", link: "/development/specific/demo_output" },

docs/development/controller/controller.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/development/controller/event.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/development/controller/init.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

docs/development/controller/navigated.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

docs/development/navigation/app_state.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
outline: [2, 4]
33
---
4-
# App State
4+
# App State, Share, Bookmark
55

6-
abap2UI5 saves the current app state so you can return to it later — like how standard UI5 apps manage state.
6+
abap2UI5 saves the current app state so you can return to it later — like how standard UI5 apps manage state. This opens up several useful options, like sharing and bookmarking the current state of your app.
77

88
### Usage
99
Each state persists as a draft with a unique ID. Calling `client->set_app_state_active` appends this ID as a hash fragment to the URL. The resulting URL is shareable — copy it and open it in another browser window (or send it to a colleague) to restore the same app state. The hash value (`z2ui5-xapp-state=...`) is a server-side key that points to the saved draft. Drafts expire after a configurable time (default: 4 hours, adjustable via [User Exits](/advanced/extensibility/user_exits)).
@@ -47,3 +47,40 @@ ENDCLASS.
4747
```
4848

4949
For a complete implementation, see sample `Z2UI5_CL_DEMO_APP_321`.
50+
51+
### Share
52+
Add a share button that copies the current state to the clipboard to share with colleagues:
53+
```abap
54+
CLASS z2ui5_cl_sample_share DEFINITION PUBLIC.
55+
56+
PUBLIC SECTION.
57+
INTERFACES z2ui5_if_app.
58+
DATA mv_quantity TYPE string.
59+
60+
ENDCLASS.
61+
62+
CLASS z2ui5_cl_sample_share IMPLEMENTATION.
63+
METHOD z2ui5_if_app~main.
64+
65+
CASE abap_true.
66+
67+
WHEN client->check_on_navigated( ).
68+
69+
DATA(view) = z2ui5_cl_xml_view=>factory( )->shell( )->page(
70+
)->label( `quantity`
71+
)->input( client->_bind_edit( mv_quantity )
72+
)->button( text = `share` press = client->_event( `BUTTON_POST` ) ).
73+
client->view_display( view->stringify( ) ).
74+
75+
WHEN client->check_on_event( `BUTTON_POST` ).
76+
77+
client->follow_up_action( client->_event_client( z2ui5_if_client=>cs_event-CLIPBOARD_APP_STATE ) ).
78+
client->message_toast_display( `clipboard copied` ).
79+
80+
ENDCASE.
81+
ENDMETHOD.
82+
ENDCLASS.
83+
```
84+
85+
### Bookmark
86+
You can also use these URLs for bookmarking, but note that the server keeps the app state only for a limited time. The default is 4 hours. See the [draft service](https://github.com/abap2UI5/abap2UI5/blob/main/src/01/01/z2ui5_cl_core_srv_draft.clas.abap#L46) source.

docs/development/navigation/share.md

Lines changed: 0 additions & 43 deletions
This file was deleted.

docs/development/specific/clipboard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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 [Share, Bookmark](../navigation/share.md).
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).
4848

4949
::: warning
5050
The browser's Clipboard API requires HTTPS (or `localhost`). On plain HTTP the call is silently ignored.

docs/get_started/next.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ outline: [2, 4]
66
With abap2UI5 up and running, here are a few directions to take.
77

88
#### Development
9-
Learn how to build views, handle events, share data, and work with tables. The development guide covers what you need for everyday work. Start with the [Development guide](/development/controller/controller).
9+
Learn how to build views, handle events, share data, and work with tables. The development guide covers what you need for everyday work. Start with the [Development guide](/development/controller/life_cycle).
1010

1111
#### Configuration
1212
Getting ready for production? The configuration guides walk through security, performance tuning, Launchpad integration, and more. Start with the [Configuration guide](/configuration/setup).

0 commit comments

Comments
 (0)