Class Fragment.ReadyEvent

java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<Fragment<?>>
io.jmix.flowui.fragment.Fragment.ReadyEvent
All Implemented Interfaces:
Serializable
Enclosing class:
Fragment<T extends com.vaadin.flow.component.Component>

public static class Fragment.ReadyEvent extends com.vaadin.flow.component.ComponentEvent<Fragment<?>>
The event that is fired after the fragment and all its declaratively defined inner components are created and fully initialized.

In this event listener, you can make final configuration of the fragment and its inner components, e.g. obtain inner components using Fragment.getInnerComponent(String) and add their specific event listeners. For example:

     public StepperField() {
         addReadyListener(this::onReady);
     }

     private void onReady(ReadyEvent readyEvent) {
         valueField = getInnerComponent("valueField");
         setValue(0);

         upBtn = getInnerComponent("upBtn");
         upBtn.addClickListener(__ -> updateValue(1));

         downBtn = getInnerComponent("downBtn");
         downBtn.addClickListener(__ -> updateValue(-1));
     }
 
See Also:
  • Constructor Details

    • ReadyEvent

      public ReadyEvent(Fragment<?> source)