Author: nbelaevski
Date: 2009-04-23 19:13:10 -0400 (Thu, 23 Apr 2009)
New Revision: 13809
Modified:
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
Log:
https://jira.jboss.org/jira/browse/RF-6788
Modified:
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
---
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2009-04-23
23:09:16 UTC (rev 13808)
+++
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2009-04-23
23:13:10 UTC (rev 13809)
@@ -245,16 +245,22 @@
protected String getItemLabel(FacesContext context, UIInplaceSelect component, Object
value) {
String itemLabel = null;
+ boolean equivValues;
+
// TODO: SelectUtils.getSelectItems is called minimum twice during encode
- if(value != null) {
- List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
- if (!selectItems.isEmpty()) {
- for (SelectItem item : selectItems) {
- if (value.equals(item.getValue())) {
- itemLabel = component.isShowValueInView() ? getConvertedStringValue(context,
component, item.getValue()) : item.getLabel();
- break;
- }
+ List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
+ if (!selectItems.isEmpty()) {
+ for (SelectItem item : selectItems) {
+ if (value != null) {
+ equivValues = value.equals(item.getValue());
+ } else {
+ equivValues = item.getValue() == null;
}
+
+ if (equivValues) {
+ itemLabel = component.isShowValueInView() ? getConvertedStringValue(context,
component, item.getValue()) : item.getLabel();
+ break;
+ }
}
}