Demos /

DynamicTableModule

Working framework components, paired with the Java that composes them.

DynamicTableModule

Submit a value to replace actual table data.

Dynamic table

Value
Compose, Render
Java composition
String value = "Compose, Render";
Component module = DynamicTableModule.create().withTitle("Dynamic table").withTableData(new String[]{"Value"}, Collections.singletonList(new String[]{value}));
new Div().withChild(Form.create().withAction("/demos/api/dynamic").withMethod(Form.Method.POST)
    .withHxPost("/demos/api/dynamic").withHxTarget("#dynamic-result").withHxSwap("outerHTML")
    .withChild(new HtmlTag("input", true).withAttribute("type", "hidden")
        .withAttribute("name", "kind").withAttribute("value", "dynamic-table"))
    .addField("Value", TextInput.create("value").withValue(value).required())
    .withChild(Button.submit("Update dynamic-table")))
    .withChild(new Div().withId("dynamic-result").withAttribute("aria-live", "polite").withChild(module));
// POST /demos/api/dynamic selects the same module with the submitted value.