Description
A GenericFilter preserves the data loader's own condition and combines it with the active
configuration. If a configuration is made current during the view's onInit, that own condition
is recorded incorrectly — it already includes the activated configuration. Switching to another
configuration afterwards then combines both configurations instead of replacing, so the loader gets a
contradictory condition and the grid usually comes back empty.
This happens with the plain base API (GenericFilter.setCurrentConfiguration(...) in onInit) and
with the new builder's makeCurrent(); a standalone GroupFilter is affected the same way. It is a
regression from jmix#2406 and was surfaced by jmix#5351, but it is independent of that API.
Declarative default="true" configurations are not affected.
Reproduction
A list view with a GenericFilter and two configurations on the same attribute (e.g. status =
OPEN / status = CLOSED). In onInit, make the first one current
(setCurrentConfiguration(...)). Open the view, then switch the filter to the second configuration.
- Expected: the grid shows rows of the second configuration.
- Actual: the grid is empty; the loader condition is
status = OPEN AND status = CLOSED.
Impact
Any view that activates a filter configuration programmatically in onInit (directly or via the
builder) shows wrong/empty data after the user switches configurations — a silent data-correctness
issue in a core, widely-used component.
Expected behavior
Activating a configuration in onInit must not affect later switching: switching always applies only
the target configuration's condition (on top of the loader's own condition). The filtered result on
open must also be correct.
Description
A
GenericFilterpreserves the data loader's own condition and combines it with the activeconfiguration. If a configuration is made current during the view's
onInit, that own conditionis recorded incorrectly — it already includes the activated configuration. Switching to another
configuration afterwards then combines both configurations instead of replacing, so the loader gets a
contradictory condition and the grid usually comes back empty.
This happens with the plain base API (
GenericFilter.setCurrentConfiguration(...)inonInit) andwith the new builder's
makeCurrent(); a standaloneGroupFilteris affected the same way. It is aregression from jmix#2406 and was surfaced by jmix#5351, but it is independent of that API.
Declarative
default="true"configurations are not affected.Reproduction
A list view with a
GenericFilterand two configurations on the same attribute (e.g.status=OPEN/status=CLOSED). InonInit, make the first one current(
setCurrentConfiguration(...)). Open the view, then switch the filter to the second configuration.status = OPEN AND status = CLOSED.Impact
Any view that activates a filter configuration programmatically in
onInit(directly or via thebuilder) shows wrong/empty data after the user switches configurations — a silent data-correctness
issue in a core, widely-used component.
Expected behavior
Activating a configuration in
onInitmust not affect later switching: switching always applies onlythe target configuration's condition (on top of the loader's own condition). The filtered result on
open must also be correct.