-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi, I create programmatically a grid:
...
private void createRow(Rows rows) {
for (Content c : data) {
Row row = new Row();
row.setParent(rows);
Label label = new Label(c.getId());
label.setParent(row);
Textbox textbox = new Textbox(c.getValue());
textbox.setParent(row);
}
}
...
I need to create programmatically a binding like this:
<textbox value="@bind(each.value)"/>
in order to retrieve the value in the textbox.
Thank you.
Hey there
Creating the components manually in this way is usually more of an MVC than MVVM option, however...
Since you are creating the components from Java side, you don't need the databindings to retrieve the values.
You can just do textbox.addEventListener to add an onChange event listener to your textbox, which will trigger when the user types in something. That event will have access to the data and underlying component, so you can retrieve the new value from it.
Asked: 2022-10-21 01:46:54 +0800
Seen: 7 times
Last updated: Oct 24 '22
MVVM Validator: class not found ? [closed]
Conditional evaluation component in mvvm
Children Binding : UiException Callable only in the event listener
Attributes in macro was not updated after notifyChange
Problem binding values to a composite component
How to access static member field of a class in zul without zscript
How can i load a constant in .zul