-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all,
I want to start a discussion for this fiddle
If you run the fiddle => enter text in first textbox you see the label next to the textbox is sitting itself correct.
This is normal cause I trigger the setter and he notify's the zul because he is changed.
The second textbox is almost the same, I just added an extra notifychange on the setter.
Mine expectation : the 2 labels should setting itself correct.
Result : only the label above is setting itself correct.
The third textbox is doing the result what I expected for the second one. The change is that I notify an extra field (itself).
It's strange behaviour in mine oppinion cause why do we need to declare that the field we are setting is getting updated or is it just a good functionality because we don't always have to notify the field we are setting?
I'd like to hear everybody's oppinion about this.
Greetz chill.
I agree with you that sometimes the binding mechanism is not very elegant but it is flexible. On the other hand, why did you use the @NotifyChange instead of the @DependsOn? Something like this looks more sensible to me:
public class TestVM {
private String remark;
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
@DependsOn("remark")
public String getRemark2() {
return remark;
}
public void setRemark2(String remark) {
this.remark = remark;
}
@DependsOn("remark")
public String getRemark3() {
return remark;
}
public void setRemark3(String remark) {
this.remark = remark;
}
}
Costas
Hey Costas,
I'm not (for the moment) a real fan of the DependsOn and find mixing the 2 is asking for faults to happen.
Your comment is indeed correct that it will work correctly when you use the DependsOn, maybe I need to revise mine oppinion about the DependsOn.
Greetz chill.
Asked: 2014-12-09 08:08:24 +0800
Seen: 11 times
Last updated: Dec 09 '14
Do not update to ZK Studio 2.0
Catch Server 503 Error - Or Catch Stale Page
how to save spreadsheet data into postgres database?
One controller file with multiple zul file
Why am I getting authentication error for ZK studio activation?
How can i make Tomcat (with virtual hosts) to parse the zul page in subfolders?