MishkaGervaz.Form.Web.Events.StepHandler (MishkaGervaz v0.0.1-alpha.2)

Copy Markdown View Source

Handles wizard step navigation events.

Overridable Functions

  • can_advance?/2 - Check if user can move to next step
  • advance/2 - Move to the next step
  • go_back/1 - Move to the previous step
  • goto_step/2 - Jump to a specific step (tabs mode)

User Override

defmodule MyApp.Form.StepHandler do
  use MishkaGervaz.Form.Web.Events.StepHandler

  def can_advance?(state, current_step) do
    # Custom step validation
    super(state, current_step)
  end
end

Top-level helpers find_next_step/2, find_prev_step/2, step_exists?/2 are public so user overrides can reuse them.

See MishkaGervaz.Form.Web.Events, MishkaGervaz.Form.Web.State (for :current_step, :step_states, :wizard_history), and the sibling sub-handlers.