mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 04:07:42 +08:00
PL-7530 SearchPickerField must have a default input prompt
This commit is contained in:
parent
4f86a0bee0
commit
df34716228
@ -55,11 +55,6 @@ public class SearchPickerFieldLoader extends SearchFieldLoader {
|
||||
if (StringUtils.isNotEmpty(minSearchStringLength)) {
|
||||
searchPickerField.setMinSearchStringLength(Integer.parseInt(minSearchStringLength));
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(searchPickerField.getInputPrompt())) {
|
||||
Messages messages = AppBeans.get(Messages.class);
|
||||
searchPickerField.setInputPrompt(messages.getMainMessage("searchPickerField.inputPrompt"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,8 @@
|
||||
package com.haulmont.cuba.web.gui.components;
|
||||
|
||||
import com.haulmont.chile.core.model.MetaClass;
|
||||
import com.haulmont.cuba.core.global.AppBeans;
|
||||
import com.haulmont.cuba.core.global.Messages;
|
||||
import com.haulmont.cuba.gui.components.Action;
|
||||
import com.haulmont.cuba.gui.components.Frame;
|
||||
import com.haulmont.cuba.gui.components.SearchPickerField;
|
||||
@ -27,6 +29,7 @@ import com.vaadin.data.Property;
|
||||
import com.vaadin.ui.ComboBox;
|
||||
import com.vaadin.ui.Component;
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
@ -48,6 +51,9 @@ public class WebSearchPickerField extends WebSearchField implements SearchPicker
|
||||
};
|
||||
pickerField = new WebPickerField(picker);
|
||||
|
||||
Messages messages = AppBeans.get(Messages.class);
|
||||
setInputPrompt(messages.getMainMessage("searchPickerField.inputPrompt"));
|
||||
|
||||
// Required for custom components in fieldgroup
|
||||
initValueSync(selectComponent, picker);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user