Browse Source

Changes for #5170 based on review

svn changeset:21292/svn branch:6.7
tags/6.7.0.rc1
Leif Åstrand 12 years ago
parent
commit
5d4940c165

+ 8
- 2
src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java View File

@@ -991,12 +991,14 @@ public class VFilterSelect extends Composite implements Paintable, Field,
enabled = !uidl.hasAttribute("disabled");

tb.setEnabled(enabled);
tb.setReadOnly(readonly || !textInputEnabled);
updateReadOnly();

if (client.updateComponent(this, uidl, true)) {
return;
}

// Inverse logic here to make the default case (text input enabled)
// work without additional UIDL messages
boolean noTextInput = uidl.hasAttribute(ATTR_NO_TEXT_INPUT)
&& uidl.getBooleanAttribute(ATTR_NO_TEXT_INPUT);
setTextInputEnabled(!noTextInput);
@@ -1169,13 +1171,17 @@ public class VFilterSelect extends Composite implements Paintable, Field,
initDone = true;
}

private void updateReadOnly() {
tb.setReadOnly(readonly || !textInputEnabled);
}

private void setTextInputEnabled(boolean textInputEnabled) {
if (this.textInputEnabled == textInputEnabled) {
return;
}

this.textInputEnabled = textInputEnabled;
tb.setReadOnly(!textInputEnabled);
updateReadOnly();

if (textInputEnabled) {
tb.getElement().getStyle().clearCursor();

+ 5
- 2
src/com/vaadin/ui/ComboBox.java View File

@@ -99,7 +99,9 @@ public class ComboBox extends Select {
/**
* Sets whether it is possible to input text into the field or whether the
* field area of the component is just used to show what is selected.
* field area of the component is just used to show what is selected. By
* disabling text input, the comboBox will work in the same way as a
* {@link NativeSelect}
*
* @see #isTextInputAllowed()
*
@@ -115,7 +117,8 @@ public class ComboBox extends Select {
/**
* Returns true if the user can enter text into the field to either filter
* the selections or enter a new value if {@link #isNewItemsAllowed()}
* returns true.
* returns true. If text input is disabled, the comboBox will work in the
* same way as a {@link NativeSelect}
*
* @return
*/

Loading…
Cancel
Save