modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
| 24 ++++++----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
| 2
2 files changed, 16 insertions(+), 10 deletions(-)
New commits:
commit d27c97e986177b29e232d367da80fe0db6abc7d8
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Mar 1 11:42:03 2011 -0500
fix so unset checkboxes are disabled when editor is in read-only mode
(
https://bugzilla.redhat.com/show_bug.cgi?id=642546)
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
index ba1268e..181dda0 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
@@ -1400,19 +1400,25 @@ public class ConfigurationEditor extends LocatableVLayout {
}
private boolean isReadOnly(PropertyDefinition propertyDefinition, Property property)
{
- boolean isInvalidRequiredProperty = false;
+ if (this.readOnly) {
+ return true;
+ }
+ String errorMessage = property.getErrorMessage();
+ if ((errorMessage != null) &&
(!errorMessage.trim().equals(""))) {
+ // special case 1: property has a plugin-set error message - allow user to
edit it even if it's a read-only prop,
+ // otherwise the user will have no way to give the property a new value and
thereby get things to a valid state
+ return false;
+ }
if (property instanceof PropertySimple) {
PropertySimple propertySimple = (PropertySimple) property;
- String errorMessage = propertySimple.getErrorMessage();
- if ((null == propertySimple.getStringValue()) ||
"".equals(propertySimple.getStringValue())
- || ((null != errorMessage) &&
(!"".equals(errorMessage.trim())))) {
- // Required properties with no value, or an invalid value (assumed if we
see an error message) should
- // never be set to read-only, otherwise the user will have no way to give
the property a new value and
- // thereby get things to a valid state.
- isInvalidRequiredProperty = true;
+ if (propertyDefinition.isRequired() &&
+ (propertySimple.getStringValue() == null) ||
propertySimple.getStringValue().equals("")) {
+ // special case 2: required simple prop with no value - allow user to
edit it even if it's a read-only prop,
+ // otherwise the user will have no way to give the property a new value
and thereby get things to a valid state
+ return false;
}
}
- return !isInvalidRequiredProperty && (propertyDefinition.isReadOnly() ||
this.readOnly);
+ return (propertyDefinition.isReadOnly());
}
protected List<Validator> buildValidators(PropertyDefinitionSimple
propertyDefinition, Property property) {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
index a240e45..df8c9f4 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
@@ -253,7 +253,7 @@ public class ActivityView extends LocatableVLayout implements
DashboardContainer
// TODO, add real portlets
// set leftmost column and letthe rest be equally divided
- dashboard.setColumnWidths("40%");
+ dashboard.setColumnWidths("40%", "*");
dashboard.getConfiguration().put(new PropertySimple(Dashboard.CFG_BACKGROUND,
"#F1F2F3"));
// Left Column