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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final recordA POJO class for storing properties of thePropertyFilter's initial state. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected PropertyFilterprotected FilterUrlQueryParametersSupportstatic final Stringprotected Stringprotected UrlParamSerializerFields inherited from class io.jmix.flowui.facet.urlqueryparameters.AbstractUrlQueryParametersBinder
id -
Constructor Summary
ConstructorsConstructorDescriptionPropertyFilterUrlQueryParametersBinder(PropertyFilter<?> filter, UrlParamSerializer urlParamSerializer, org.springframework.context.ApplicationContext applicationContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidRestores the component to its initial state.protected voidcom.vaadin.flow.component.ComponentReturns the component associated with this binder.Returns the value of the parameter.protected voidinitComponent(PropertyFilter<?> filter) protected voidprotected voidonValueChange(com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent event) voidSaves component's initial state.voidsetParameter(String parameter) Sets the value of the parameter.protected voidvoidupdateState(com.vaadin.flow.router.QueryParameters queryParameters) Informs query parameters binder that view query parameters has been changed.Methods inherited from class io.jmix.flowui.facet.urlqueryparameters.AbstractUrlQueryParametersBinder
addUrlQueryParametersChangeListener, fireQueryParametersChanged, getEventBus, getId, setId
-
Field Details
-
NAME
- See Also:
-
filter
-
parameter
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
urlParamSerializer
-
filterUrlQueryParametersSupport
-
initialState
-
-
Constructor Details
-
Method Details
-
autowireDependencies
protected void autowireDependencies() -
initComponent
-
saveInitialState
public void saveInitialState()Description copied from interface:HasInitialStateSaves component's initial state.- Specified by:
saveInitialStatein interfaceHasInitialState
-
onValueChange
protected void onValueChange(com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent event) -
onOperationChange
-
updateQueryParameters
protected void updateQueryParameters() -
applyInitialState
public void applyInitialState()Description copied from interface:HasInitialStateRestores the component to its initial state.- Specified by:
applyInitialStatein interfaceHasInitialState
-
updateState
public void updateState(com.vaadin.flow.router.QueryParameters queryParameters) Description copied from interface:UrlQueryParametersFacet.BinderInforms query parameters binder that view query parameters has been changed.- Specified by:
updateStatein interfaceUrlQueryParametersFacet.Binder- Parameters:
queryParameters- a view query parameters
-
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
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:AbstractUrlQueryParametersBinderReturns the component associated with this binder.- Specified by:
getComponentin classAbstractUrlQueryParametersBinder- Returns:
- the component instance if available, or
nullif no component is associated
-