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 How can I make mouseclick on an ice:inputText select all characters? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "How can I make mouseclick on an ice:inputText select all characters?" Watch "How can I make mouseclick on an ice:inputText select all characters?" New topic
Author

How can I make mouseclick on an ice:inputText select all characters?

Eli Lato
Greenhorn

Joined: Apr 10, 2011
Posts: 2
When a user tabs to the next ice:inputText field, all characters in the field are selected. So if the user types into the field, its old contents are erased. That's great.

But if a user clicks an ice:inputText, nothing is selected. So the user has to delete the old contents himself. This confuses users.

How can I make a mouseclick on an ice:inputText automatically select all characters in the field?

Thanks,
Eli
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16065
    
  21

Welcome to the JavaRanch, Eli!

HTML does this by attaching text-select code to the "focus" JavaScript event. I'm not up to date on the IceFaces input controls, but if they don't automatically do that, you can always supply your own code to do it manually.


Customer surveys are for companies who didn't pay proper attention to begin with.
Eli Lato
Greenhorn

Joined: Apr 10, 2011
Posts: 2
thanks, tim, you're right.

all i needed to do was add onfocus="this.select();"
this works for ie, which is what i need. it doesn't work for ff, but i don't care.
thanks
eli
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I make mouseclick on an ice:inputText select all characters?