FilterChipTileHolder
Constructors
Properties
Id of this tile — how TilesEditor/TilesEventDispatcher/GetData's Tile data source address it by id, and what an ancestor's getTileHolder/getEventHolder search for.
Functions
Inserts child into this tile's tiles at the position resolved by where — a no-op if this holder has no children list at all (tiles == null, i.e. it's a leaf tile). The mechanism behind AddTiles targeting this tile as groupingTileId. Does not itself mark this holder dirty or trigger a state update — callers (TilesManager.addTile/addTiles) do that explicitly right after.
Returns this tile's current T snapshot — the schema that gets serialized back to the client's UI state and, ultimately, the network. Re-derives via getTileSchema and clears the dirty flag when isDirty is true; otherwise returns the cached tile unchanged, avoiding a full subtree walk on every read.
Number of direct children currently in tiles — the mechanism behind GetTileChildrenCount.
Collects every EventSchema in this subtree — this tile's own events first, then every descendant tile's — whose trigger equals eventTrigger. Used by EventManager.triggerEvents by way of TilesEventHolder.getEventsByTrigger, the mechanism behind screen-level triggers like onDisplay() reaching every matching event anywhere in the tree, not just top-level ones.
Collects every TileHolder in this subtree (this one, then recursively through tiles) whose handlesGroupEvent returns true for event — the traversal behind TileRenderingScope.dispatchGroupEvent, which is how RadioButton's mutual exclusion reaches every radio button sharing a groupId regardless of where each one sits in the tree.
Whether this holder should react to event when it's broadcast via TileRenderingScope.dispatchGroupEvent. The default implementation never matches anything — override it (typically with a type check against your own TileGroupEvent subtype, optionally comparing a group-identifying field) on a TileHolder that participates in a group concern.
Whether every id in childrenIds is currently present among this tile's direct tiles — the mechanism behind CheckIfTileContainsChildren. An empty tiles (or a holder with no children list at all) only satisfies this for an empty childrenIds.
Whether this holder — or any descendant tile or event holder — has been markAsDirty'd since it was last read via get. Dirtiness propagates upward: a change deep in the tree marks every ancestor dirty too, the next time each one is asked.
Marks this holder as needing its schema re-derived the next time get is called, instead of returning the cached tile as-is. Every mutating operation on a holder (a child added/removed, update applied, onTileEvent/onTileGroupEvent handled) calls this immediately after.
Applies event to this tile's local, in-memory state — the local half of a stateful tile's interaction, invoked synchronously via TileRenderingScope.dispatchEvent. The default implementation does nothing; override it on a TileHolder whose tile carries local state (checked/selected/text/etc.), pattern-matching on your own TileEvent subtype and mutating tile directly (tile = tile.copy(...)) — see CheckboxTileHolder.onTileEvent for the canonical example. This runs on the UI thread and completes before recomposition, which is why it always visually settles before whatever remote EventTrigger fired alongside it (via TileRenderingScope.triggerEvent) has a chance to run.
Applies event to this tile's local state as part of a group-wide broadcast — invoked only on holders whose handlesGroupEvent returned true for the same event, via TileRenderingScope.dispatchGroupEvent. The default implementation does nothing; override it alongside handlesGroupEvent on a TileHolder that participates in a mutual-exclusion-style group (the way RadioButton clears every other radio button sharing its groupId).
Exposes a value this tile currently holds, addressed by key — the mechanism behind the Tile data source (tile(tileId, dataKey) in the server DSL), read by GetData/EvaluateData. The default implementation exposes nothing (null); override it on a TileHolder whose tile has a value worth reading this way (see CheckboxTileHolder, which exposes mapOf(key to tile.checked) — key is ignored there since a checkbox only ever has one value to expose, but a tile with several distinct values would branch on it).
Same as removeChild, for every child whose id is in ids.
Applies updateData as a shallow JSON-patch merge onto this tile's current tile, the mechanism behind UpdateTiles. style is handled as its own nested merge (a patch under the "style" key is merged onto the current style object specifically, rather than replacing it wholesale) — every other top-level key in updateData simply overwrites the matching key on the encoded tile object. The merged JSON is then decoded back into a fresh T instance via the framework's dev.catbit.mosaic.core.serialization.MosaicSerializer, which is why an update that would leave the tile in an undecodable shape (e.g. a required field turned into the wrong JSON type) fails and is logged rather than partially applied.
Removes every child from tiles — a no-op if this holder has no children list. The mechanism behind WipeTiles, and the first step of ReplaceTiles before the new children are added.