Re: limiting a textfield to numbers

2014-11-11 Thread Johann Werner
Hi Ted, if your „problem“ is related to a specific textfield then you can add a numberformat binding to that WOTextField. This should give you a validation exception if your user entered a non-number value. jw > Am 08.11.2014 um 06:04 schrieb Theodore Petrosky : > > I’ve never written a vali

Re: limiting a textfield to numbers

2014-11-10 Thread Timothy Worman
I use Integer.parseInt - throws NumberFormatException if the String does not contain a parseable integer. Tim UCLA GSE&IS > On Nov 7, 2014, at 9:04 PM, Theodore Petrosky wrote: > > I’ve never written a validator before. Is this okay: > > public String validateJobNumber(String value) thr

Re: limiting a textfield to numbers

2014-11-07 Thread Theodore Petrosky
I’ve never written a validator before. Is this okay: public String validateJobNumber(String value) throws ValidationException { value = value.trim(); boolean isNumber = true; endOfLoop: for (int i = 0; i < value.length(); i

Re: limiting a textfield to numbers

2014-11-07 Thread Ruggentaler, JR
You could also try client side validation HTML 5 input validation. http://www.pageresource.com/html5/input-validation-tutorial/ JR Sent from my iPhone > On Nov 7, 2014, at 7:05 PM, Ramsey Gurley wrote: > > If you always only want to allow number characters, then implement a > validateKey() m

Re: limiting a textfield to numbers

2014-11-07 Thread Ramsey Gurley
If you always only want to allow number characters, then implement a validateKey() method for that key on your EO. This is easier. public String validateJobNumber(String value) Alternately, you can provide a custom component that does the validation at the component level. For example, you have

limiting a textfield to numbers

2014-11-07 Thread Theodore Petrosky
How would you limit the characters typed into a WOTextField in a D2W app? I need a text field for a Job Number. It’s not really a number per se. Although I want to limit the characters typed to the number keys. So basically ascii 48 to 57 inclusive. Ted