Re: How to format number in (Number)TextField?

2017-10-24 Thread Kamil Paśko
Thanks! Combining it with custom Behavior should do the trick W dniu 2017-10-24 o 16:52, Maxim Solodovnik pisze: I believe by overriding textFormat you can customize the way number is being displayed And the way text is being converted to number inside wicket. to format field data while user

Re: How to format number in (Number)TextField?

2017-10-24 Thread Maxim Solodovnik
I believe by overriding textFormat you can customize the way number is being displayed And the way text is being converted to number inside wicket. to format field data while user prints you need to use JS llibrary for ex. this one http://flaviosilveira.com/Jquery-Price-Format/ looks promising ...

Re: How to format number in (Number)TextField?

2017-10-24 Thread Kamil Paśko
Maxim, I tried with:     private final class MyFormattedField extends TextField implements ITextFormatProvider {         private MyFormattedField(String id, IModel model) {             super(id, model);         }         @Override         public String getTextFormat() {             return "##

Re: How to format number in (Number)TextField?

2017-10-24 Thread Kamil Paśko
I tried with: @Override         protected void onInitialize() {             super.onInitialize();             InputMaskBehavior mask = new InputMaskBehavior() {                 @Override                 protected String getMask() {                     return "999 999.99";                 }      

Re: How to format number in (Number)TextField?

2017-10-24 Thread Francois Meillet
You can use an input with a mask something like Have a look at https://igorescobar.github.io/jQuery-Mask-Plugin/ François > Le 24 oct. 2017 à 14:37, Maxim Solodovnik a écrit : > > I believe you can override "getTextFormat >

Re: How to format number in (Number)TextField?

2017-10-24 Thread Maxim Solodovnik
I believe you can override "getTextFormat ()" method and provide your own format According to right align: you can use CSS class for that :) On Tue,

How to format number in (Number)TextField?

2017-10-24 Thread Kamil Paśko
Dear Wicket user group, I have a TextField (but I can use NumberTextField as well) and when user types a number I want that: 1) number is positioned to the right 2) thousands are separated by spaces 3) floating point character is "." How can I "force" that format in a TextField? Kind rega