0

Contraints

asked 2006-04-09 14:41:11 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3677115

By: the-e-factory


Hi,

is it possible to add more then one contraint (object that implement the constraint interface)to a textbox ?

is it possible somehow to check if a textbox is in error considering the a particular constraint by code on the server, for example:

Constraint constraint = textbox.getConstraint();

contraint.isInError() returns boolean ?

I see in the api for constraint that there is one method that returns a boolean:
isClientComplete()
I try to use this but it seems it's there for some other reason ?

thanks
eduard


delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2006-04-09 20:01:09 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3677383

By: oberinspector

as i understood the api there is nothing like isInError(), but you can retrieve the constraint from a component and call the validate method direct. if you want to handle the error yourself you probably have to catch the WrongValueExeception thrown by validate:

Textbox nickname = (Textbox) comp.getFellow("nickname"); Textbox email = (Textbox) comp.getFellow("email");

//throws WrongValueException
nickname.getConstraint().validate(nickname, nickname.getValue());
email.getConstraint().validate(email, email.getValue());

link publish delete flag offensive edit

answered 2006-04-10 04:21:33 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3677761

By: tomyeh

isClientComplete is used to denote whether all validation can be done by JavaScript codes. If true, it optimizes one round-trip communication overhead.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2006-04-09 14:41:11 +0800

Seen: 245 times

Last updated: Apr 10 '06

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More