-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have a custom constraint which I need to use sometimes with ZK's default constraint.
here is my sample code:
<zscript>
EmailConstraint ec = new EmailConstraint();
</zscript>
<textbox id="email" value="@{user.email}" constraint="no empty, ${ec}" />
I got an exception when page is rendered...Message is "unknown constraint"
Can I use custom constraint and default constraint together?
thx
Paula
Does your custom constraint extends the SimpleConstraint?
You might want to simplify it, just extends the SimpleConstraint, create new flags, so that
you can instantiate your custom constraint with the new flags,
and then try to apply the constraint from the composer, not from the .zul file. :)
No, my custom constraint just implement Constraint.
I created my custom constraint base on the instruction on this page:
http://books.zkoss.org/wiki/ZK_Component_Reference/Base_Components/InputElement#Custom_Constraint
Hi pjiang,
You cannot use the default one with the custom one.
So you can even not mix default and custom constraints programmatically?
For example is this fiddle only possible, if you remove the modulo constraint?
zkfiddle.org/sample/3hpmnka/13-Multiple-custom-constraints-mixed-with-default-constraints
Asked: 2012-06-21 21:59:42 +0800
Seen: 206 times
Last updated: Nov 13 '13