"buttonImageUrl"
};
protected void configureInputComponent(FacesContext context, ExpressionFilter filter, UIInput inputComponent) {
DropDownField field = (DropDownField) inputComponent;
field.setOnchange(getFilterSubmissionScript(filter));
field.setOnkeypress(getFilterKeyPressScript(filter));
field.setStyle(filter.getStyle());
field.setStyleClass(Styles.mergeClassNames(filter.getStyleClass(), "o_fullWidth"));
field.setListStyle("font-weight: normal;");
String rolloverItemClass = Styles.getCSSClass(context,
filter, "background: " + DefaultStyles.getSelectionBackgroundColor() +
" !important; color: " + DefaultStyles.getSelectionTextColor() + " !important;", StyleGroup.selectedStyleGroup(), null);
field.setRolloverListItemClass(rolloverItemClass);
int childrenCount = field.getChildren().size();
if (childrenCount != 1) {
throw new IllegalStateException("Search component of DropDownFieldFilter should have exactly one child component - " +
"the DropDownItems component. children.size = " + childrenCount);
}
Object dropDownFieldItems = field.getChildren().get(0);
if (!(dropDownFieldItems instanceof DropDownItems)) {
throw new IllegalStateException("Search component of DropDownFieldFilter should have exactly one child component - " +
"instance of DropDownItems component. But was - " + dropDownFieldItems.toString());
}
DropDownItems dropDownItems = (DropDownItems) dropDownFieldItems;
Collection<Object> possibleValuesCollection = filter.calculateAllCriterionNames(context);
for (Iterator<Object> criterionIterator = possibleValuesCollection.iterator(); criterionIterator.hasNext();) {
Object criterionObj = criterionIterator.next();
if (isEmptyItem(criterionObj)) {
criterionIterator.remove();
}
}
List<Object> availableItems = new ArrayList<Object>(possibleValuesCollection);
List<DropDownItem> itemList = new ArrayList<DropDownItem>(availableItems.size());
for (Object itemObj : availableItems) {
DropDownItem item = createDropDownItem(context, itemObj);
itemList.add(item);
}
DropDownItem allRecordsItem = createDropDownItem(context, null);
String allRecordsCriterionName = filter.getAllRecordsText();
HtmlOutputText outputText = Components.createOutputText(context, allRecordsCriterionName);
String predefinedCriterionClass = getPredefinedCriterionClass(context, filter);
outputText.setStyleClass(predefinedCriterionClass);
allRecordsItem.getChildren().add(outputText);
itemList.add(0, allRecordsItem);
dropDownItems.setValue(itemList);
List<UIComponent> children = field.getChildren();
children.clear();
children.add(dropDownItems);
}