Class PropertyFilterUrlQueryParametersBinder

java.lang.Object
io.jmix.flowui.facet.urlqueryparameters.AbstractUrlQueryParametersBinder
io.jmix.flowui.facet.urlqueryparameters.PropertyFilterUrlQueryParametersBinder
All Implemented Interfaces:
HasInitialState, UrlQueryParametersFacet.Binder

public class PropertyFilterUrlQueryParametersBinder extends AbstractUrlQueryParametersBinder implements HasInitialState
A URL query parameters binder for PropertyFilter components. This class enables binding a PropertyFilter to URL query parameters, allowing the component's state to be reflected in and restored from the URL.

The class listens to changes in the PropertyFilter, such as value or operation changes, and updates the corresponding query parameters. It also supports saving and restoring the PropertyFilter's initial state.

  • Field Details

  • Constructor Details

    • PropertyFilterUrlQueryParametersBinder

      public PropertyFilterUrlQueryParametersBinder(PropertyFilter<?> filter, UrlParamSerializer urlParamSerializer, org.springframework.context.ApplicationContext applicationContext)
  • Method Details

    • autowireDependencies

      protected void autowireDependencies()
    • initComponent

      protected void initComponent(PropertyFilter<?> filter)
    • saveInitialState

      public void saveInitialState()
      Description copied from interface: HasInitialState
      Saves component's initial state.
      Specified by:
      saveInitialState in interface HasInitialState
    • onValueChange

      protected void onValueChange(com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent event)
    • onOperationChange

      protected void onOperationChange(PropertyFilter.OperationChangeEvent<?> event)
    • updateQueryParameters

      protected void updateQueryParameters()
    • applyInitialState

      public void applyInitialState()
      Description copied from interface: HasInitialState
      Restores the component to its initial state.
      Specified by:
      applyInitialState in interface HasInitialState
    • updateState

      public void updateState(com.vaadin.flow.router.QueryParameters queryParameters)
      Description copied from interface: UrlQueryParametersFacet.Binder
      Informs query parameters binder that view query parameters has been changed.
      Specified by:
      updateState in interface UrlQueryParametersFacet.Binder
      Parameters:
      queryParameters - a view query parameters
    • getParameter

      public String getParameter()
      Returns the value of the parameter. If the parameter is not explicitly set, it defaults to the filter's ID.
      Returns:
      the value of the parameter
      Throws:
      IllegalStateException - if neither parameter nor filter ID is available
    • setParameter

      public void setParameter(@Nullable String parameter)
      Sets the value of the parameter.
      Parameters:
      parameter - the value to set for the parameter
    • getComponent

      @Nullable public com.vaadin.flow.component.Component getComponent()
      Description copied from class: AbstractUrlQueryParametersBinder
      Returns the component associated with this binder.
      Specified by:
      getComponent in class AbstractUrlQueryParametersBinder
      Returns:
      the component instance if available, or null if no component is associated