summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonatan Kronqvist <jonatan.kronqvist@itmill.com>2010-07-07 12:33:47 +0000
committerJonatan Kronqvist <jonatan.kronqvist@itmill.com>2010-07-07 12:33:47 +0000
commit29a7df25a5d2518b65ae058fa296a59d8fe9f2fb (patch)
tree16ea0b92ce2e6c6422a7d94bffa0ba2df3fbdb11 /src
parentcc4af8eeb0e8f755ecb22982a3a5fb7c72650470 (diff)
downloadvaadin-framework-29a7df25a5d2518b65ae058fa296a59d8fe9f2fb.tar.gz
vaadin-framework-29a7df25a5d2518b65ae058fa296a59d8fe9f2fb.zip
Applied the patch from #4448
svn changeset:14140/svn branch:6.4
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VTextField.java28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java
index 50c81e19bd..90d7d789a8 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java
@@ -113,19 +113,11 @@ public class VTextField extends TextBoxBase implements Paintable, Field,
setColumns(new Integer(uidl.getStringAttribute("cols")).intValue());
}
- String text = uidl.hasVariable("text") ? uidl.getStringVariable("text")
- : null;
+ final String text = uidl.hasVariable("text") ? uidl
+ .getStringVariable("text") : null;
setPrompting(inputPrompt != null && focusedTextField != this
&& (text == null || text.equals("")));
- final String fieldValue;
- if (prompting) {
- fieldValue = isReadOnly() ? "" : inputPrompt;
- addStyleDependentName(CLASSNAME_PROMPT);
- } else {
- fieldValue = text;
- removeStyleDependentName(CLASSNAME_PROMPT);
- }
if (BrowserInfo.get().isGecko()) {
/*
* Gecko is really sluggish when updating input attached to dom.
@@ -136,10 +128,26 @@ public class VTextField extends TextBoxBase implements Paintable, Field,
*/
DeferredCommand.addCommand(new Command() {
public void execute() {
+ String fieldValue;
+ if (prompting) {
+ fieldValue = isReadOnly() ? "" : inputPrompt;
+ addStyleDependentName(CLASSNAME_PROMPT);
+ } else {
+ fieldValue = text;
+ removeStyleDependentName(CLASSNAME_PROMPT);
+ }
setText(fieldValue);
}
});
} else {
+ String fieldValue;
+ if (prompting) {
+ fieldValue = isReadOnly() ? "" : inputPrompt;
+ addStyleDependentName(CLASSNAME_PROMPT);
+ } else {
+ fieldValue = text;
+ removeStyleDependentName(CLASSNAME_PROMPT);
+ }
setText(fieldValue);
}