https://github.com/crusaider/gwt-valueboxlabeler
https://github.com/crusaider/gwt-valueboxlabeler
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/crusaider/gwt-valueboxlabeler
- Owner: crusaider
- License: apache-2.0
- Created: 2014-03-26T07:18:56.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-30T08:41:21.000Z (about 11 years ago)
- Last Synced: 2025-01-28T03:35:12.380Z (4 months ago)
- Language: Java
- Homepage:
- Size: 7.79 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#GWT-ValueBoxLabeler
A utillity class that adds whatever text is defined in the title attribute as a background in the text box as long as the user has not entered any value in the widget. The background text can be added to any of the ValueBox based GWT widgets.

When the user enters (focuses) the widget, the background text is removed, when the user leaves (blurs) the widget the background is added again if the text box contains no value.
The text displayed text in the box is defined using the widgets title attribute.
The appearance of the background text is controlled trough the CSS class
`Labeled-Text-Box`.Use the class by instantiating a object of it suppling the widget to be
labeled to the constructor.Solution inspiration from [this blog post] (http://viralpatel.net/blogs/default-text-label-textbox-javascript-jquery/)
by [Viral Patel](https://plus.google.com/+ViralPatel1/about)##Usage
Either simply copy the file ValueBoxLabeler.java file into your project,
possibly adjusting the package, or put the the `valueboxlabeler-x.x.x.jar`
on your class path.If you choose to use the jar you will also have to have a `inherits` line
in your module(s):``
To add a label to a textbox widget, set the title attribute of the widget,
instanciate a instance of the ValueBoxLabel class suppying the text box
widget to the constructor.
```
TextBox textbox = new TextBox();
textbox.setTitle("Label shown in textbox");new ValueBoxLabeler(textbox);
```