Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ npm run check # build + test, what CI runs
box and the image in a fallback font too: system fonts differ in width, so
leave room. `36-where-the-screen-is-written.svg` is the one comparison with
UI5 Freestyle and RAP; #36 and #37 both show it.
- **One dispatcher.** `main( )` in an example is the `IF check_on_init( )` /
`ELSEIF check_on_navigated( )` / `ELSEIF check_on_event( )` chain, in that
order - the form of the framework guide (`docs/agents/building-apps.md` in
abap2UI5/abap2UI5) and of the sample repositories. No `CASE abap_true`.
- **No script, no inline style.** The policy is `script-src 'self';
style-src 'self'`: no `<script>`, no `on…=` handler, no `style=""` - the test
holds every page to it. That is why code is highlighted by Prism (token
Expand Down
19 changes: 9 additions & 10 deletions src/content/essays/07-one-click-one-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ can answer:

me->client = client.

CASE abap_true.
WHEN client->check_on_init( ).
data_read( ). " once - this instance has never run
view_display( ).
WHEN client->check_on_navigated( ).
view_display( ). " back from a sub-app or a popup: hand a view back
WHEN client->check_on_event( `SAVE` ).
on_save( ). " the model changed - the view stands
ENDCASE.
IF client->check_on_init( ).
data_read( ). " once - this instance has never run
view_display( ).
ELSEIF client->check_on_navigated( ).
view_display( ). " back from a sub-app or a popup: hand a view back
ELSEIF client->check_on_event( `SAVE` ).
on_save( ). " the model changed - the view stands
ENDIF.

ENDMETHOD.
```
Expand All @@ -51,7 +50,7 @@ one, because two of them are the mistakes everybody makes exactly once.

**Init before navigated.** `check_on_init( )` is true exactly once, on the very
first call. Every path to a first call raises `check_on_navigated( )` as well,
so in a `CASE abap_true` the first match wins and the init branch has to stand
so in the `ELSEIF` chain the first match wins and the init branch has to stand
first, or the one-time setup never runs.

**A return owes a view.** Coming back from a sub-app or a value help does not
Expand Down
2 changes: 1 addition & 1 deletion src/content/essays/18-call-screen-leave-screen.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ waited. What it has to do is show its view again, because the browser is still
displaying the sub-app's. And it can read what the sub-app left behind:

```abap
WHEN client->check_on_navigated( ).
ELSEIF client->check_on_navigated( ).
TRY.
DATA(detail) = CAST zcl_sample_detail( client->get_app_prev( ) ).
message = detail->result.
Expand Down
19 changes: 9 additions & 10 deletions src/content/essays/24-nothing-runs-between-two-clicks.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,15 @@ user can watch — and cancel, which the two-minute dialog step never offered.
for its status on a timer:

```abap
CASE abap_true.
WHEN client->check_on_event( `START` ).
job_schedule( ). " remembers job name and count
poll( ).
WHEN client->check_on_event( `POLL` ).
status_read( ). " TBTCO, or the API of ABAP Cloud
IF status <> `F` AND status <> `A`.
poll( ). " not finished: ask again
ENDIF.
ENDCASE.
IF client->check_on_event( `START` ).
job_schedule( ). " remembers job name and count
poll( ).
ELSEIF client->check_on_event( `POLL` ).
status_read( ). " TBTCO, or the API of ABAP Cloud
IF status <> `F` AND status <> `A`.
poll( ). " not finished: ask again
ENDIF.
ENDIF.
```

```abap
Expand Down
21 changes: 10 additions & 11 deletions src/content/essays/27-abap-unit-for-a-screen.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,16 @@ CLASS zcl_sample_overdue IMPLEMENTATION.

me->client = client.

CASE abap_true.
WHEN client->check_on_init( ).
key_date = sy-datum.
data_read( ).
overdue_calc( ).
view_display( ).
WHEN client->check_on_navigated( ).
view_display( ).
WHEN client->check_on_event( `RECALC` ).
overdue_calc( ).
ENDCASE.
IF client->check_on_init( ).
key_date = sy-datum.
data_read( ).
overdue_calc( ).
view_display( ).
ELSEIF client->check_on_navigated( ).
view_display( ).
ELSEIF client->check_on_event( `RECALC` ).
overdue_calc( ).
ENDIF.

ENDMETHOD.

Expand Down
Loading