Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Events and Actions in Model Injection

Adrián Rivero edited this page Feb 17, 2016 · 4 revisions

When injecting a model, there's 4 annotations available that can be used to modulate the injection process. The annotations that need an event, also require to annotate the enclosing class with @UseEventBus.

@LoadOnEvent

This annotation takes as parameter an event class. It will inject the field only when the event is received, avoiding injecting the class when the class is loading (similar than a Lazy load, but this one is triggered with an event).

@UpdateOnEvent

This annotation takes as parameter an event class. It will inject the field when an event is received.

@PutOnEvent

This annotation takes as parameter an event class. It will put the field when an event is received.

@PutOnAction

This annotation takes as parameter an Id. It will put the field when the view with the provided Id be clicked.

See also

  • [Events and Models Example](Events and Models Example)