-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Good day, a problem that is happening to users is that they copy and paste numeric values very frequently on an Intbox, however in some cases some additional spaces are also copied inadvertently for the user and when they try to paste in the Intbox field they can't because these are interpreted as alphanumeric. If they paste from clipboard in a Textbox then the numbers are pasted with the additional leading or trailing spaces. Is it a way to capture the Paste event in the Intbox and trim() clipboard selection before value is passed to the Intbox? I have already tried extending Intbox and overriding setValue, setText and similar methods to no avail. I am using ZKEE 8.6.1.
Hi There,
You won't get to the value in Java code, because it is being filtered by the client-side JS and prevented from even going through if incorrect. I think the best place to override this would be in zul.inp.Intbox.prototype._shallIgnore which controls whether to keep or throw the copy/paste action. (it checks the pasted data for non-number characters, then accepts or rejects it).
Made a short fiddle to illustrate:
http://zkfiddle.org/sample/3faufjm/2-intbox-check-trim-spaces
Asked: 2019-12-09 12:54:36 +0800
Seen: 7 times
Last updated: Dec 09 '19
[ZK8.6 Preview] New media components coming soon!
Bug in Datebox with lenient=false and value 01.04.1981?
javascript cannot catch id of zul component. Please help.
failed to utilize getTop(), getLeft() on div(component). Please help.
Serving zul files from a directory outside web application