Is there a way to add leading zeroes to a spinner?

38 views
Skip to first unread message

George Ch.

unread,
Jun 15, 2017, 12:06:11 PM6/15/17
to wicket-jquery-ui
Hello!

I was wondering if there is a way to add leading zeroes on a spinner.
I tried ModelType String but it does not extend Number so this just gets a compilation exception, and through HTML5 I got nowhere.

Thanks in advance,
George

Sebastien

unread,
Jun 15, 2017, 12:09:16 PM6/15/17
to wicket-j...@googlegroups.com
Hi George,

Did you tried something with numberFormat option and globalize ?

http://api.jqueryui.com/spinner/#option-numberFormat

Best regards,
Sebastien.

George Ch.

unread,
Jun 16, 2017, 3:50:32 AM6/16/17
to wicket-jquery-ui
Dear Sebastien,

setNumberFormat is "not activated" in Spinner.class,
So instead I overrode the onConfigure and added the below.

this.options.set("numberFormat", Options.asString("d2"));

And this seems to work well :) Thank you!

Best Regards,
George

Sebastien

unread,
Jun 16, 2017, 3:53:48 AM6/16/17
to wicket-j...@googlegroups.com
Spinner is a component, imo that's better if you override onConfigure(JQueryBehavior) and then call behavior.setOption(...)

Sebastien

unread,
Jun 16, 2017, 3:56:07 AM6/16/17
to wicket-j...@googlegroups.com
or, if the spinner takes an option as ctor argh, you could pass it here

Reply all
Reply to author
Forward
0 new messages