Custom TextBox

119 views
Skip to first unread message

Fabricio Pizzichillo

unread,
Feb 13, 2012, 1:44:29 PM2/13/12
to google-we...@googlegroups.com
Hello friends.
I need to implement a TextBox that can be assigned an Integer and it shows in this format "7732137/6"

Can you help?

regards

Fabricio

Ashwin Desikan

unread,
Feb 13, 2012, 2:41:18 PM2/13/12
to google-we...@googlegroups.com
You can use IntergerBox or if using editor framework use ValueBoxEdiyorDecorator<Integer>

I don't think you can display in the format u want using the above options. 

Have you tried using a regular textbox And converting your integer to a string in whatever format before displaying on screen?

~Ashwin

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Fabricio Pizzichillo

unread,
Feb 13, 2012, 5:39:18 PM2/13/12
to google-we...@googlegroups.com
Thanks for the reply.

Can I use NumberFormat for this? if so, how would the pattern?
regards

2012/2/13 Ashwin Desikan <ashwin....@gmail.com>

Thomas Broyer

unread,
Feb 14, 2012, 3:46:17 AM2/14/12
to google-we...@googlegroups.com
With a ValueBox you can use the Renderer and Parser of your choice, not necessarily tied to NumberFormat. IntegerBox is simply a ValueBox<Integer> whose Renderer and Parser delegate to a NumberFormat.

Fabricio Pizzichillo

unread,
Feb 14, 2012, 4:56:34 AM2/14/12
to google-we...@googlegroups.com
Thanks Thomas.
I'll try to do.
Reards

2012/2/14 Thomas Broyer <t.br...@gmail.com>
With a ValueBox you can use the Renderer and Parser of your choice, not necessarily tied to NumberFormat. IntegerBox is simply a ValueBox<Integer> whose Renderer and Parser delegate to a NumberFormat.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

linhua

unread,
Feb 15, 2012, 2:08:35 AM2/15/12
to Google Web Toolkit
What I think is, may you be able to write a sub class extends TextBox?
Override several method, handle the conversion?

On 2月14日, 上午2时44分, Fabricio Pizzichillo <fpizzichi...@gmail.com>
wrote:

Thomas Broyer

unread,
Feb 15, 2012, 4:39:21 AM2/15/12
to google-we...@googlegroups.com
A TextBox is simply a ValueBox<String> using PassthroughRenderer and PassthroughParser, so it's simpler to simply use ValueBox with your own renderer and parser.

Fabricio Pizzichillo

unread,
Feb 15, 2012, 5:12:19 AM2/15/12
to google-we...@googlegroups.com
Hi friends.
I have made the implementation mentioned by Thomas. Works great!

regards

2012/2/15 Thomas Broyer <t.br...@gmail.com>
A TextBox is simply a ValueBox<String> using PassthroughRenderer and PassthroughParser, so it's simpler to simply use ValueBox with your own renderer and parser.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
Reply all
Reply to author
Forward
0 new messages