I tried with:

@Override
        protected void onInitialize() {
            super.onInitialize();
            InputMaskBehavior mask = new InputMaskBehavior() {

                @Override
                protected String getMask() {
                    return "999 999.99";
                }
            };
            add(mask);
        }

but this forces the user to type exactly what mask shows, so user can not type:

123 nor 123.11, it must be 123 123.11


W dniu 2017-10-24 o 14:48, Francois Meillet pisze:
You can use an input with a mask
something like <input type="text" class="masked" data-format="999 999 999.99" >
Have a look at https://igorescobar.github.io/jQuery-Mask-Plugin/ 
<https://igorescobar.github.io/jQuery-Mask-Plugin/>

François



Le 24 oct. 2017 à 14:37, Maxim Solodovnik <solomax...@gmail.com> a écrit :

I believe you can override "getTextFormat 
<https://ci.apache.org/projects/wicket/apidocs/8.x/org/apache/wicket/markup/html/form/AbstractTextComponent.ITextFormatProvider.html#getTextFormat-->()"
 method and provide your own format
According to right align: you can use CSS class for that :)

On Tue, Oct 24, 2017 at 6:52 PM, Kamil Paśko <kamil.pa...@solsoft.pl 
<mailto:kamil.pa...@solsoft.pl>> wrote:
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 regards,

Kamil



--
WBR
Maxim aka solomax



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to