File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes inputText customized behaviour (newbie) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "inputText customized behaviour (newbie)" Watch "inputText customized behaviour (newbie)" New topic
Author

inputText customized behaviour (newbie)

Shailesh Paranjpe
Greenhorn

Joined: Jul 29, 2009
Posts: 5
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

Joined: Jul 29, 2009
Posts: 5
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: inputText customized behaviour (newbie)