0

Zk Datebox clear constrained value

asked 2015-09-29 13:06:17 +0800

javiut gravatar image javiut flag of Venezuela, Bolivarian Republic of
90 1 5

updated 2015-09-29 14:20:35 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

I have two Dateboxes one of them with constraint something like this

<label sclass="labelNormal" value="InitialDate" />
<datebox id="from"/>                                   
<label sclass="labelNormal" value="FinalDate" />
<datebox id="to" constraint="${dualDateValidatorWithRange}"/>

The constrains validate that from date is less than to date if not a wrongValueException takes place the constraint works ok the problems arises i have a button which clears all the inputElements in my view when the constraint is fire and later i click on the button clear i couldn't find a way to clear the value or text or any from to datebox i have try in ZUL and in a Java class the following code with not success.

to.setValue(null);to.setRawValue(null);to.setText(null);

But i still can see the last selected date on the datebox what else can i do to erase all the value and text from datebox.

I have create a fiddle sample here

http://zkfiddle.org/direct/lu9c0j/5/v7.0.6.1-ClearDateboxWithConstraintNotWorking?run=13jmcku

delete flag offensive retag edit

Comments

javiut, is your other question duplicate or not?

chillworld ( 2015-09-30 09:32:42 +0800 )edit

Is not..best regards chillworld

javiut ( 2015-09-30 11:07:05 +0800 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-09-29 14:14:58 +0800

Darksu gravatar image Darksu
1991 1 4

Hello javiut,

If you had shared the code i could help even more but you try disabling the constraint, set the new value (empty string), and re-enable the constraint.

Let me know how it went.

Best Regards,

Darksu

link publish delete flag offensive edit

Comments

that worked... kind annoying thanks a lot.

javiut ( 2015-09-30 11:06:32 +0800 )edit
1

answered 2015-09-29 14:35:55 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

Updated the fiddle :

Changed the order of the clearance to :

to.setRawValue(null);
to.setText(null);
to.setValue(null);

Greetz chill.

link publish delete flag offensive edit
Your answer
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
1 follower

RSS

Stats

Asked: 2015-09-29 13:06:17 +0800

Seen: 22 times

Last updated: Sep 29 '15

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