File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

inputText customized behaviour (newbie)

 
Shailesh Paranjpe
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to enable inputText to accept only doubles.

Use cases: Input 1t (or T) (and similar treatment for m/M as a million multiplier) and the control should display it as 1000 (with locale based formatting) Input 1000 and the control should display 1000 with locale based formatting

I created custom converters and in getAsObject attempted to convert from the string to the appropriate double amount. ( I never get into the converter code because there is no POST action yet- I think).

I want the "conversion" to happen when the user tabs out of the field. What are the possible approaches to this problem? I would like to do this on the serverside as I want to follow a similar approach for some other controls I would need where the formatting depends on some other information being passed from the client.

In addition, I would like to indicate an invalid entry for the control as well.

Regards
-- Shailesh
 
Shailesh Paranjpe
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shailesh Paranjpe wrote:I would like to enable inputText to accept only doubles.

Use cases: Input 1t (or T) (and similar treatment for m/M as a million multiplier) and the control should display it as 1000 (with locale based formatting) Input 1000 and the control should display 1000 with locale based formatting

I created custom converters and in getAsObject attempted to convert from the string to the appropriate double amount. ( I never get into the converter code because there is no POST action yet- I think).

I want the "conversion" to happen when the user tabs out of the field. What are the possible approaches to this problem? I would like to do this on the serverside as I want to follow a similar approach for some other controls I would need where the formatting depends on some other information being passed from the client.

In addition, I would like to indicate an invalid entry for the control as well.

Regards
-- Shailesh


I forgot to add. I would like to package the control as a reusable component.
I googled and saw something akin to this in icefaces, partialSubmit. I am using Richfaces however

Regards
--Shailesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic