-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
I've got a textbox like this :
<textbox hflex="1" constraint="no empty: Mandatory field" ...../>
I'm ussing MVVC and I've got a "save" button to perform the save on my form on server side.
When I open a new form, my textbox is empty. If I click on save, i've made a validation on server side saying that "the value of the textbox need to be entered".
So far so good...
But when I open a new form, I enterred "text" in the textbox and I press save, my form is persisted with the value "test" in my database and my form is refresh. Now, in the textbox, I delete all the text, I press "save" and I have a different behavior : server side my object hasn't a null value but keeps the "test" value and my textbox is surrended with red.
I hope you understand, i'm french and my english is bad...
I would like that if I clear a textbox, the "null" value is send to the server.
Thank you !
I created a fiddle : http://zkfiddle.org/sample/mh714r/1-constraint-test-MVC
It works here but if you can alter it to your situation and mention the version so we can check it out.
Chill.
Hello pafi,
Don't forget that you can always create your custom constraints via java as shown below:
https://www.zkoss.org/wiki/ZKComponentReference/Base_Components/InputElement
It comes in handy many times!
Best Regards,
Darksu
Asked: 2016-10-03 04:27:06 +0800
Seen: 104 times
Last updated: Oct 03 '16
ZK + Hibernate validation using JSR
howto change Datebox format error message
Session Timeout on Upload Button [closed]
ZK MVVM Validation Focus on First Error
how to clear validation messages
Create Crud of a User that has a collection of books
could binder.sendCommand return a result of Validation?
textbox constraint emailadress upgrade to disallow mycomp.com [closed]