com.vaadin.flow.data.renderer.
Class RendererUtil
- java.lang.Object
-
- com.vaadin.flow.data.renderer.RendererUtil
-
public class RendererUtil extends Object
Contains helper methods to register events triggered by rendered templates.
Used internally by components that support
TemplateRenderer
.Author:
Vaadin Ltd
-
-
Method Summary
All Methods Modifier and Type Method Description static <T> void
registerEventHandlers(Renderer<T> renderer, Element contentTemplate, Element templateDataHost, ValueProvider<String,T> keyMapper)
Registers the event handlers associated to a
TemplateRenderer
, if any.
-
-
-
Method Detail
-
registerEventHandlers
public static <T> void registerEventHandlers(Renderer<T> renderer, Element contentTemplate, Element templateDataHost, ValueProvider<String,T> keyMapper)
Registers the event handlers associated to a
TemplateRenderer
, if any. The consumers returned byRenderer.getEventHandlers()
are processed and properly configured to trigger messages from the client to the server, so event handlers can catch the events and execute custom logic.Type Parameters:
T
- the type of the renderer and the associated keyMapperParameters:
renderer
- the TemplateRenderer to be evaluatedcontentTemplate
- the<template>
element that contains the children that fire eventstemplateDataHost
- the data host of the events - typically the parent of the contentTemplate, but not necessarilykeyMapper
- a value provider that knows how to return items by a given key
-
-