-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello, I'm migrating from zk 7.0.8.1 to 8.6.0.1 and I'm facing some problems with custom constraints. I try to make a simple example that works with zk7 and doesn't work with zk8.
I'have a TestConstraint class that extends SimpleConstraint, like this:
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.WrongValueException;
import org.zkoss.zul.SimpleConstraint;
public class TestConstraint extends SimpleConstraint {
private static final long serialVersionUID = 694308029327860534L;
public TestConstraint(String constraints) {
super(constraints);
}
public TestConstraint(int flags) {
super(flags);
}
@Override
public void validate(Component comp, Object value) throws WrongValueException {
super.validate(comp, value);
}
}
In the VM I declare and instantiate my two simple constraints for having no empty values in my input element:
private transient TestConstraint constraintByString;
private transient TestConstraint constraintByFlag;
public TestConstraint getConstraintByString() {
if (constraintByString == null) {
constraintByString = new TestConstraint("no empty");
}
return constraintByString;
}
public TestConstraint getConstraintByFlag() {
if (constraintByFlag == null) {
constraintByFlag = new TestConstraint(256);
}
return constraintByFlag;
}
In the zul I use these constraints for two datebox:
<datebox value="@bind(vm.start)"
format="dd/MM/yyyy HH:mm:ss" cols="19"
constraint="${vm.constraintByString}" />
<datebox value="@bind(vm.start)"
format="dd/MM/yyyy HH:mm:ss" cols="19"
constraint="${vm.constraintByFlag}" />
With zk7 both the constraints work; with zk8 the first one works, the second one doesn't work. What am I doing wrong?
Thanks in advance.
Filippo
thanks for posting this issue. I simplified the problem and posted the JIRA issue ZK-4190
A workaround is also provided in JIRA and can be applied to a zul file as in this example
UPDATE: ZK-4190 has been fixed in the latest FL version 8.6.1.FL.20190125
Sorry @cor3000, yesterday I posted this JIRA issue ZK-4187!
Asked: 2019-01-08 16:01:26 +0800
Seen: 13 times
Last updated: Jan 28 '19
int box and constraint="no negative"
[Announcement] ZK 8.6 Introductory Session Open for Registration
how to set the global font-size
I configured iceblue_c theme, but it did not work. Please advise. Thank you
request hot fix for CE version for issue ZK-4127
Can you set min-width for columns in the grid that identify hflex=1?