]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix for #3886 - InputPrompt of TextField/Combobox does not change until refresh
authorArtur Signell <artur.signell@itmill.com>
Fri, 18 Dec 2009 08:06:22 +0000 (08:06 +0000)
committerArtur Signell <artur.signell@itmill.com>
Fri, 18 Dec 2009 08:06:22 +0000 (08:06 +0000)
svn changeset:10410/svn branch:6.2

src/com/vaadin/ui/ComboBox.java

index f8c65d557363e875e497d7f111190f71aa6be474..a9cdf21bd1f9dfd253bbe900ba3b5488a994537e 100644 (file)
@@ -23,66 +23,67 @@ import com.vaadin.terminal.gwt.client.ui.VFilterSelect;
 @ClientWidget(VFilterSelect.class)\r
 public class ComboBox extends Select {\r
 \r
-       private String inputPrompt = null;\r
+    private String inputPrompt = null;\r
 \r
-       public ComboBox() {\r
-               setMultiSelect(false);\r
-               setNewItemsAllowed(false);\r
-       }\r
+    public ComboBox() {\r
+        setMultiSelect(false);\r
+        setNewItemsAllowed(false);\r
+    }\r
 \r
-       public ComboBox(String caption, Collection options) {\r
-               super(caption, options);\r
-               setMultiSelect(false);\r
-               setNewItemsAllowed(false);\r
-       }\r
+    public ComboBox(String caption, Collection options) {\r
+        super(caption, options);\r
+        setMultiSelect(false);\r
+        setNewItemsAllowed(false);\r
+    }\r
 \r
-       public ComboBox(String caption, Container dataSource) {\r
-               super(caption, dataSource);\r
-               setMultiSelect(false);\r
-               setNewItemsAllowed(false);\r
-       }\r
+    public ComboBox(String caption, Container dataSource) {\r
+        super(caption, dataSource);\r
+        setMultiSelect(false);\r
+        setNewItemsAllowed(false);\r
+    }\r
 \r
-       public ComboBox(String caption) {\r
-               super(caption);\r
-               setMultiSelect(false);\r
-               setNewItemsAllowed(false);\r
-       }\r
+    public ComboBox(String caption) {\r
+        super(caption);\r
+        setMultiSelect(false);\r
+        setNewItemsAllowed(false);\r
+    }\r
 \r
-       @Override\r
-       public void setMultiSelect(boolean multiSelect) {\r
-               if (multiSelect && !isMultiSelect()) {\r
-                       throw new UnsupportedOperationException("Multiselect not supported");\r
-               }\r
-               super.setMultiSelect(multiSelect);\r
-       }\r
+    @Override\r
+    public void setMultiSelect(boolean multiSelect) {\r
+        if (multiSelect && !isMultiSelect()) {\r
+            throw new UnsupportedOperationException("Multiselect not supported");\r
+        }\r
+        super.setMultiSelect(multiSelect);\r
+    }\r
 \r
-       /**\r
-        * Gets the current input prompt.\r
-        \r
-        * @see #setInputPrompt(String)\r
-        * @return the current input prompt, or null if not enabled\r
-        */\r
-       public String getInputPrompt() {\r
-               return inputPrompt;\r
-       }\r
+    /**\r
+     * Gets the current input prompt.\r
+     * \r
+     * @see #setInputPrompt(String)\r
+     * @return the current input prompt, or null if not enabled\r
+     */\r
+    public String getInputPrompt() {\r
+        return inputPrompt;\r
+    }\r
 \r
-       /**\r
-        * Sets the input prompt - a textual prompt that is displayed when the\r
-        * select would otherwise be empty, to prompt the user for input.\r
-        * \r
-        * @param inputPrompt\r
-        *            the desired input prompt, or null to disable\r
-        */\r
-       public void setInputPrompt(String inputPrompt) {\r
-               this.inputPrompt = inputPrompt;\r
-       }\r
+    /**\r
+     * Sets the input prompt - a textual prompt that is displayed when the\r
+     * select would otherwise be empty, to prompt the user for input.\r
+     * \r
+     * @param inputPrompt\r
+     *            the desired input prompt, or null to disable\r
+     */\r
+    public void setInputPrompt(String inputPrompt) {\r
+        this.inputPrompt = inputPrompt;\r
+        requestRepaint();\r
+    }\r
 \r
-       @Override\r
-       public void paintContent(PaintTarget target) throws PaintException {\r
-               if (inputPrompt != null) {\r
-                       target.addAttribute("prompt", inputPrompt);\r
-               }\r
-               super.paintContent(target);\r
-       }\r
+    @Override\r
+    public void paintContent(PaintTarget target) throws PaintException {\r
+        if (inputPrompt != null) {\r
+            target.addAttribute("prompt", inputPrompt);\r
+        }\r
+        super.paintContent(target);\r
+    }\r
 \r
 }\r