jidefx-oss icon indicating copy to clipboard operation
jidefx-oss copied to clipboard

DoubleField - Cannot make it empty once number are entered?

Open ghost opened this issue 11 years ago • 2 comments

If remove all text and move the focus, it bring back to one that was there. Is there any way to make it allow empty?

I know I can enter zero (0) value but zero and empty are different sometimes.

Thanks.

ghost avatar Nov 19 '13 16:11 ghost

I see your point. You are certainly correct. The reason we did this way is because the FormattedTextField constantly checks the text to make sure it is at the correct format so we wish there is always a value there. commitEdit method is the that that checks the value. If the value converted from the text is null, it will return false and then the field will revert to the previous value. You probably can override the commitEdit to allow null for now. We will have to go through all the code to prevent possible NPE when the value is null.

jidesoft avatar Nov 19 '13 16:11 jidesoft

Thanks. Overriding the commitEdit works for me.

ghost avatar Nov 19 '13 18:11 ghost