asked
2014-06-13 06:46:51 +0800
chillworld
5357 ● 4 ● 9
https://github.com/chillw...
Hi all,
I have a little problem with the following.(MVC)
Assume I have the following textbox :
<customtextbox constraint="no empty" ctrlKeys="^l"/>
Now on the control key we will open a catalog popup.
If the textbox is empty I will get a WrongValueException
because the focus is lost of the textbox.
The notification balloon pops up in front of mine catalog.
I tried before opening the modal popup :
Clients.clearWrongValue(this.textbox);
and
Clients.clearWrongValue(this);
(the this
is a class that extends HtmlMacroComponent
and the textbox is wired)
The popup is still there while he shouldn't be there.
Any other solutions you can suggest?
Edit :
After fully debugging what the problem could be I came to the following conclusion :
With the lose of focus, I run a java script for the constraint to check if it is not null.
Because it is null, the java script opens the errormessage.
It's java script what's killing me.
Is there a possibility to disable the java-script validation with the constraint propertie?
How debugged
- Class overriding of
Textbox
.
Add extra logging to see where the WrongValueException is coming from.
Nu succes.
- Class overriding of
InputElement
.
Add extra logging to see where the WrongValueException is coming from..
Nu succes.
- Class overriding of
WrongValueException
.
Add extra logging to all
the constructors so I would see where this Exception is created.
No such exception is created while opening the catalog, but the error message is still there.
So th eonly solution is that it is coming from java script with the focus lost
event.
For me it's a bug cause constraint error message should appear in the window where the component is, not overlapping other windows who stands higher in the chain, like a messagePopup or a new window.
Greetz chill.
This is one of the reason, i move to Server side validation. you have to manually click to close the warning message.
Senthilchettyin ( 2014-06-13 08:27:47 +0800 )editI'm debugging atm, seems I call the clear before the WrongValueException. I can follow you completly why you did that
chillworld ( 2014-06-13 08:48:13 +0800 )edit