Skip to content

An example of creating web components using server side Java

Notifications You must be signed in to change notification settings

vaadin/server-side-web-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Uses the new web component export feature of Flow 1.5 to export server side Java classes as web components.

For example

@Tag("my-fancy-component")
public static class MyFancyComponentExporter implements WebComponentExporter<MyFancyComponent> {

  @Override
  public void define(WebComponentDefinition<MyFancyComponent> definition) {
    definition.addProperty("response", "Hello").onChange((component, value) -> {
                        component.response = value;
    });
    definition.addProperty("message", "").onChange((component, value) -> {
                        component.setMessage(value);
    });
  }
}

exports the component class MyFancyComponent and publishes two properties message and response. If these are changed in the browser, the corresponding field in the component is updated or the corresponding method is called.

About

An example of creating web components using server side Java

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published