Interface ConfigContext
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
TriggerSupport
Context passed into
buildClientConfig so trigger/action/output
subclasses can reference other outputs and elements by stable id without
needing direct access to the host's TriggerSupport.
For internal use only.
-
Method Summary
Modifier and TypeMethodDescriptiongetHost()The host element this snapshot belongs to.default intreferenceElement(Component component) Returns a stable parameter index for the given component's root element.intreferenceElement(Element element) Returns a stable parameter index for the given element.intregisterOutput(Output<?> output) Returns a stable id for the given output, registering it with the host's TriggerSupport if it hasn't been registered yet.voidSchedules a fresh client snapshot for the host to be emitted on the nextbeforeClientResponseflush.
-
Method Details
-
registerOutput
Returns a stable id for the given output, registering it with the host's TriggerSupport if it hasn't been registered yet.- Parameters:
output- the output to reference, notnull- Returns:
- the id of the output in the surrounding snapshot
-
referenceElement
Returns a stable parameter index for the given element. Host element is index0(thisin the executeJs invocation); other elements get sequential indices starting at1.- Parameters:
element- the element to reference, notnull- Returns:
- the parameter index
-
referenceElement
Returns a stable parameter index for the given component's root element.- Parameters:
component- the component to reference, notnull- Returns:
- the parameter index
-
getHost
Element getHost()The host element this snapshot belongs to. Useful for outputs that install element-scoped subscriptions (e.g.SignalOutputviaElementEffect.effect).- Returns:
- the host element
-
scheduleSync
void scheduleSync()Schedules a fresh client snapshot for the host to be emitted on the nextbeforeClientResponseflush. Used by outputs whose value may change between trigger fires (e.g. aSignalOutput). Idempotent within a request.
-