1. Domino Brix
  2. Routing

Registering routes

Annotate presenters with @BrixRoute and wrap them in @BrixComponent. Generated routing providers register the presenter with Domino History so pushing a token activates the presenter.

			@BrixPresenter
@BrixRoute("dashboard")
@BrixComponent(presenter = DashboardPresenter.class)
public class DashboardComponent {}

// navigate
Brix.get().router().pushToken("dashboard");

		

Parameterized routes

Use :param placeholders in the route path. Brix and Domino History parse path, query, and fragment parts and map them to annotated fields.

			@BrixPresenter
@BrixRoute("customers/:customerId/orders/:orderId")
@BrixComponent(presenter = OrderDetailsPresenter.class)
public class OrderDetailsComponent {}
// customers/42/orders/7 => customerId=42, orderId=7

		

Access routing state

Annotated fields are refreshed before activation and on token changes. You can also read directly from the routing state for richer access or override setState to map into custom fields.

			public class CustomerPresenter extends Presenter<CustomerView> {
  @PathParameter("customerId") String id;
  @QueryParameter("filter") String filter;
  @FragmentParameter String tab;

  @Override
  protected void onActivated() {
    view.loadCustomer(id, filter, tab);
  }

  @Override
  protected void onStateChanged() {
    view.reload(id, filter, tab);
  }
}

		

Child routes & navigation

  • Child presenters merge parent and child token filters so parents activate first.
  • Hash vs path routing: routes containing # use fragment-based filters; others use path filters.
  • Use Brix.get().router().pushToken(...) to navigate programmatically.
  • Views implementing CanConfirmNavigation/ProvidesConfirmNavigation register a history interceptor during activation.

We are a group of passionate people who love what we do

Donate & Support Us