Class ContextInput<T>
java.lang.Object
com.vaadin.flow.component.trigger.internal.Action.Input<T>
com.vaadin.flow.component.trigger.internal.ContextInput<T>
- Type Parameters:
T- the runtime type of the value produced
- All Implemented Interfaces:
Serializable
Reads a value out of the trigger context — the object a trigger supplies to
describe what it fired for. A
SinkTrigger rendered into a template
supplies {args}, the arguments the template called the action with,
so new ContextInput<String>("args", "0") yields the first of them at
fire time.
This is what lets one action serve every element a renderer draws: the value is not captured on the server per element, the template passes it when the action runs.
For internal use only. May be renamed or removed in a future release.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionContextInput(String contextProperty, String valueProperty) Creates an input readingcontext[contextProperty][valueProperty]at fire time. -
Method Summary
Modifier and TypeMethodDescriptionBuilds theJsFunctionthat yields this input's value when called.
-
Constructor Details
-
ContextInput
Creates an input readingcontext[contextProperty][valueProperty]at fire time.- Parameters:
contextProperty- the context member to read from (e.g."args"), notnullvalueProperty- the property to read off that member, notnull
-
-
Method Details
-
toJs
Description copied from class:Action.InputBuilds theJsFunctionthat yields this input's value when called. The function may takeeventandcontextas runtime arguments (declared by the snippet that builds it with@JsFunctionParameterNames); inputs that need neither simply omit the declaration and ignore the arguments the caller passes.Public so that
Actionimplementations in any package can consume inputs they receive as parameters, not only inputs they created themselves.- Specified by:
toJsin classAction.Input<T>- Parameters:
trigger- the surrounding trigger this render is for, notnull- Returns:
- the input's JS function, not
null
-