-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
I have a list of rows that I would like to display in a zul page.
....
List<Row> rows = new ArrayList<>();
@Init
public void init() {
Row row = new Row();
Label label = new Label();
label.setValue("description1");
row.appendChild(label);
Textbox text = new Textbox();
text.setValue("static textbox");
row.appendChild(text);
rows.add(row);
}
....
public List<Row> getRows() {
return rows;
}
In the zul page I tried this but it doesn't work:
...
<grid model="@load(vm.rows)">
<columns>
<column label="column1" />
<column label="column2" />
</columns>
<rows>
<template name="model">
@load(each)
</template>
</rows>
</grid>
From this grid tutorial it shows something similar but it uses EL expression and as far as I know this is loaded only once and it cannot change its content, that's not what I need because the list of these rows can change at runtime through a button for example.
I created this fiddle with the above test.
What is the simplest way to do something like this? Thank you
I found a solution, hope this helps
Asked: 2022-03-18 22:51:07 +0800
Seen: 3 times
Last updated: Mar 19 '22