1
0
mirror of https://github.com/1C-Company/v8-code-style.git synced 2024-12-14 14:10:09 +02:00
v8-code-style/bundles/com.e1c.v8codestyle.form/markdown/form-items-single-event-handler.md
RedMammoth b9d720966f
#855 Проверка form-items-single-event-handler (#998)
* Добавил проверку единичного использования обработчика событий
2022-07-03 10:04:53 +03:00

654 B

Check handler has assigned to a single event

Check handler has assigned to a single event

Noncompliant Code Example

If you mix two event in a single procedure, its logic gets complicated and decreases its stability.

Compliant Solution

Assign a handler for each event. If different actions are required in case of events in different form items:

  • Create a separate procedure or a function that executes the required action.
  • Сreate a separate handler for each form item.
  • Call the required procedure or function from each handler.

See

Module structure