Interface Handled<T>

Type Parameters:
T - The builder type.
All Known Implementing Classes:
CardSpec, DetailTab, PageSpec, RibbonItem, RowDetail, SwitcherDef.Section, SwitcherDef.View, TableSpec

public interface Handled<T>
Mixin for element builders that can carry a client object-model block: handler actions, lifecycle bindings and handler subscriptions. Implementers supply modelBlock() and self().

Example:

CardSpec.of("html", "orders") .action("archive", "archive", "orders.archive") .on("rendered", "orders.wire") .subscribe("selection:orders", "orders.onSelect");

Since:
10.0.0
  • Method Details

    • modelBlock

      Returns the element's model block.
      Returns:
      The block; never null.
    • self

      T self()
      Returns this builder.
      Returns:
      This object.
    • action

      default T action(String id, String icon, String handler)
      Adds a click action calling a named handler.
      Parameters:
      id - The action id.
      icon - The icon name.
      handler - The handler name.
      Returns:
      This object.
    • action

      default T action(String id, String icon, String handler, Map<String,Object> payload)
      Adds a click action with a payload.
      Parameters:
      id - The action id.
      icon - The icon name.
      handler - The handler name.
      payload - The payload.
      Returns:
      This object.
    • action

      default T action(ModelAction a)
      Adds a fully specified action.
      Parameters:
      a - The action.
      Returns:
      This object.
    • on

      default T on(String event, String handler)
      Binds a lifecycle event to a named handler.
      Parameters:
      event - The event.
      handler - The handler name.
      Returns:
      This object.
    • on

      default T on(String event, HandlerRef handler)
      Binds a lifecycle event.
      Parameters:
      event - The event.
      handler - The handler.
      Returns:
      This object.
    • subscribe

      default T subscribe(String topic, String handler)
      Subscribes a named handler to a topic.
      Parameters:
      topic - The topic; may hold {rowKey}, {tabId}, {cardId}.
      handler - The handler name.
      Returns:
      This object.
    • subscribe

      default T subscribe(String topic, HandlerRef handler)
      Subscribes a handler to a topic.
      Parameters:
      topic - The topic.
      handler - The handler.
      Returns:
      This object.