use of com.vaadin.flow.component.polymertemplate.EventHandler in project flow by vaadin.
the class SubPropertyModelTemplate method sync.
@EventHandler
private void sync() {
Div div = new Div();
div.setId("synced-msg");
div.setText(getStatus().getMessage());
((HasComponents) getParent().get()).add(div);
}
use of com.vaadin.flow.component.polymertemplate.EventHandler in project flow by vaadin.
the class SubPropertyModelTemplate method click.
@EventHandler
private void click(@ModelItem("status") Status statusItem) {
Div div = new Div();
div.setId("statusClick");
div.setText(statusItem.getMessage());
((HasComponents) getParent().get()).add(div);
}
use of com.vaadin.flow.component.polymertemplate.EventHandler in project flow by vaadin.
the class EventHandlerView method sendData.
@EventHandler
private void sendData(@EventData("event.button") int button, @EventData("event.type") String type, @EventData("event.srcElement.tagName") String tag) {
Element container = ElementFactory.createDiv();
container.appendChild(ElementFactory.createDiv("Received event from the client with the data:"));
container.appendChild(ElementFactory.createDiv("button: " + button));
container.appendChild(ElementFactory.createDiv("type: " + type));
container.appendChild(ElementFactory.createDiv("tag: " + tag.toLowerCase(Locale.ENGLISH)));
container.setAttribute("id", "event-data");
getParent().get().getElement().appendChild(container);
}
Aggregations