Skip to content

Refactor event handling to use check_on_event method#573

Merged
oblomov-dev merged 2 commits intostandardfrom
claude/add-check-on-event-method-Vptv7
Mar 5, 2026
Merged

Refactor event handling to use check_on_event method#573
oblomov-dev merged 2 commits intostandardfrom
claude/add-check-on-event-method-Vptv7

Conversation

@oblomov-dev
Copy link
Member

Summary

Refactored event handling across multiple demo app classes to use the check_on_event() helper method instead of manual CASE statements, improving code consistency and readability.

Key Changes

  • Replaced CASE client->get( )-event WHEN ... ENDCASE patterns with IF client->check_on_event( 'EVENT_NAME' ) in 5 demo app classes:
    • z2ui5_cl_demo_app_001: BUTTON_POST event
    • z2ui5_cl_demo_app_021: POST event
    • z2ui5_cl_demo_app_255: POPOVER event
    • z2ui5_cl_demo_app_297: CLICK_HINT_ICON event
    • z2ui5_cl_demo_app_309: CUSTOM_JS_FROM_EB event

Implementation Details

  • The check_on_event() method encapsulates the event comparison logic, eliminating the need for explicit client->get( )-event calls
  • All event handling logic remains functionally identical; this is purely a refactoring for code clarity
  • The IF/ENDIF structure is more concise than CASE/WHEN/ENDCASE for single event checks
  • Improves maintainability by using a consistent pattern across the codebase

https://claude.ai/code/session_01FvX8PAG8E6rmJhdMGX6kVL

claude added 2 commits March 5, 2026 07:13
Replace CASE/WHEN with IF client->check_on_event() in on_event
methods that only handle a single event. Applied to demo apps
001, 021, 255, 297, and 309.

https://claude.ai/code/session_01FvX8PAG8E6rmJhdMGX6kVL
Replace CASE/WHEN with IF client->check_on_event() in all on_event
methods that handle only a single event. 70 additional files refactored.

https://claude.ai/code/session_01FvX8PAG8E6rmJhdMGX6kVL
@oblomov-dev oblomov-dev merged commit 49c800e into standard Mar 5, 2026
6 checks passed
@oblomov-dev oblomov-dev deleted the claude/add-check-on-event-method-Vptv7 branch March 5, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants