@Renderer(rendererType = "com.example.CustomComponentRenderer", componentFamily = "com.example.CustomComponent")
@Tag(name = "customComponent")
public class CustomComponent extends UIComponentBase {
...
}
@Property(name = "text", type = String.class, defaultValue = "Default Text")
@Attribute(name = "text", type = String.class)
public String getText() {
return (String) getStateHelper().eval(PropertyKeys.text, "Default Text");
}
public void setText(String text) {
getStateHelper().put(PropertyKeys.text, text);
}
@EventHandler(event = "customEvent", type = String.class)
public void handleCustomEvent(CustomEvent event) {
...
}