modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java
| 9 +++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
| 25 +++++++++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
| 4 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftConfigurationView.java
| 3 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
| 3 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java
| 6 ++
12 files changed, 53 insertions(+), 9 deletions(-)
New commits:
commit 85882c6e0e00d5d788032d9c4192577c21e4fcc6
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Aug 30 13:27:27 2011 -0400
[BZ 733613 - Add button got disabled, if user cancel the drift creation]
Regression due to new footer disablement in Table, on footer action. The
footer actions are now responsible for footer re-enablement upon action
completion (or as soon as it is safe). This commit fixes various instances
of the problem when canceling out of wizards. At the moment there are
no other known occurrences since most actions do perform some sort of
Table refresh on completion.
- Change Table.refreshTableActions public as opposed to private. This allows
actions to update button enablement without requiring a full refresh/cache
invalidation.
- Add jdoc in Table to let adders of table actions know they are responsible
for the necessary refresh.
- Fixed for Group creation, Drift config creation, Child resource create
and import, bundle creation.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java
index bf9db3e..9db4577 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java
@@ -138,6 +138,9 @@ public class BundlesListView extends
Table<BundlesWithLatestVersionDataSource> {
(hasAuth) ? TableActionEnablement.ALWAYS : TableActionEnablement.NEVER)
{
public void executeAction(ListGridRecord[] selection, Object actionValue)
{
new BundleCreateWizard().startWizard();
+ // we can refresh the table buttons immediately since the wizard is a
dialog, the
+ // user can't access enabled buttons anyway.
+ BundlesListView.this.refreshTableInfo();
}
});
@@ -185,6 +188,9 @@ public class BundlesListView extends
Table<BundlesWithLatestVersionDataSource> {
public void executeAction(ListGridRecord[] selection, Object actionValue)
{
if (selection.length == 0) {
new BundleDeployWizard().startWizard();
+ // we can refresh the table buttons immediately since the wizard
is a dialog, the
+ // user can't access enabled buttons anyway.
+ BundlesListView.this.refreshTableInfo();
return;
}
@@ -207,6 +213,9 @@ public class BundlesListView extends
Table<BundlesWithLatestVersionDataSource> {
return;
}
new BundleDeployWizard(result.get(0).getId()).startWizard();
+ // we can refresh the table buttons immediately since the
wizard is a dialog, the
+ // user can't access enabled buttons anyway.
+ BundlesListView.this.refreshTableInfo();
}
});
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
index 0caeb61..933aa01 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
@@ -801,14 +801,32 @@ public class Table<DS extends RPCDataSource> extends
LocatableHLayout implements
this.titleComponent = canvas;
}
+ /**
+ * Note: To prevent user action while a current action completes, all widgets on the
footer are disabled
+ * when footer actions take place, typically a button click. It is up to the action
to ensure the page
+ * (via refresh() or CoreGUI.refresh()) or footer (via refreshTableActions) are
refreshed as needed at action
+ * completion. Failure to do so may leave the widgets disabled.
+ */
public void addTableAction(String locatorId, String title, TableAction tableAction)
{
this.addTableAction(locatorId, title, null, null, tableAction);
}
+ /**
+ * Note: To prevent user action while a current action completes, all widgets on the
footer are disabled
+ * when footer actions take place, typically a button click. It is up to the action
to ensure the page
+ * (via refresh() or CoreGUI.refresh()) or footer (via refreshTableActions) are
refreshed as needed at action
+ * completion. Failure to do so may leave the widgets disabled.
+ */
public void addTableAction(String locatorId, String title, String confirmation,
TableAction tableAction) {
this.addTableAction(locatorId, title, confirmation, null, tableAction);
}
+ /**
+ * Note: To prevent user action while a current action completes, all widgets on the
footer are disabled
+ * when footer actions take place, typically a button click. It is up to the action
to ensure the page
+ * (via refresh() or CoreGUI.refresh()) or footer (via refreshTableActions) are
refreshed as needed at action
+ * completion. Failure to do so may leave the widgets disabled.
+ */
public void addTableAction(String locatorId, String title, String confirmation,
LinkedHashMap<String, ? extends Object> valueMap, TableAction tableAction)
{
// If the specified locator ID is qualified, strip off the ancestry prefix, so we
can make sure its locator ID
@@ -831,6 +849,11 @@ public class Table<DS extends RPCDataSource> extends
LocatableHLayout implements
/**
* Adds extra widgets to the bottom of the table view.
+ * <br/><br/>
+ * Note: To prevent user action while a current action completes, all widgets on the
footer are disabled
+ * when footer actions take place, typically a button click. It is up to the action
to ensure the page
+ * (via refresh() or CoreGUI.refresh()) or footer (via refreshTableActions) are
refreshed as needed at action
+ * completion. Failure to do so may leave the widgets disabled.
*
* @param widget the new widget to add to the table view
* @param aboveFooter if true, the widget will be placed in a second toolstrip just
above the main footer.
@@ -880,7 +903,7 @@ public class Table<DS extends RPCDataSource> extends
LocatableHLayout implements
return this.tableActionDisableOverride;
}
- protected void refreshTableInfo() {
+ public void refreshTableInfo() {
if (this.showFooter && (this.listGrid != null)) {
if (this.tableActionDisableOverride) {
this.listGrid.setSelectionType(SelectionStyle.NONE);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
index 653df07..1b23485 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
@@ -354,7 +354,7 @@ public class GroupConfigurationUpdatesPortlet extends LocatableVLayout
implement
}
@Override
- protected void refreshTableInfo() {
+ public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
int count = getListGrid().getSelection().length;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
index 901c38d..9cfa362 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
@@ -366,7 +366,7 @@ class GroupOperationsCriteriaHistoryListView extends
GroupOperationHistoryListVi
}
@Override
- protected void refreshTableInfo() {
+ public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
int count = getListGrid().getSelection().length;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
index 7b3b86d..b165048 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
@@ -16,9 +16,9 @@ import com.smartgwt.client.widgets.form.events.SubmitValuesHandler;
import com.smartgwt.client.widgets.form.fields.CheckboxItem;
import com.smartgwt.client.widgets.form.fields.FormItem;
import com.smartgwt.client.widgets.form.fields.SelectItem;
-
import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridRecord;
+
import org.rhq.core.domain.alert.Alert;
import org.rhq.core.domain.alert.AlertPriority;
import org.rhq.core.domain.authz.Permission;
@@ -281,7 +281,7 @@ public abstract class AbstractRecentAlertsPortlet extends
AlertHistoryView imple
}
@Override
- protected void refreshTableInfo() {
+ public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
int count = getListGrid().getSelection().length;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java
index 94cec23..f26e9b4 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java
@@ -293,7 +293,7 @@ public abstract class AbstractRecentDriftsPortlet extends
DriftHistoryView imple
}
@Override
- protected void refreshTableInfo() {
+ public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
int count = getListGrid().getSelection().length;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java
index 7b0cb59..150f869 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java
@@ -249,7 +249,7 @@ public abstract class AbstractOperationHistoryPortlet extends
OperationHistoryVi
}
@Override
- protected void refreshTableInfo() {
+ public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
int count = getListGrid().getSelection().length;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
index 6c25762..7c91dc1 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
@@ -310,7 +310,7 @@ public class ProblemResourcesPortlet extends
Table<ProblemResourcesDataSource> i
return definition;
}
- protected void refreshTableInfo() {
+ public void refreshTableInfo() {
if (isShowFooter()) {
long begin = 0;
List<Long> bounds =
MeasurementUtility.calculateTimeFrame(getDataSource()
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
index 448f357..002d600 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
@@ -148,7 +148,7 @@ public class ResourceConfigurationUpdatesPortlet extends
GroupConfigurationUpdat
}
@Override
- protected void refreshTableInfo() {
+ public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
int count = getListGrid().getSelection().length;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftConfigurationView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftConfigurationView.java
index abdc35e..364d25d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftConfigurationView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftConfigurationView.java
@@ -170,6 +170,9 @@ public class DriftConfigurationView extends
TableSection<DriftConfigurationDataS
private void add() {
DriftAddConfigWizard.showWizard(context, this);
+ // we can refresh the table buttons immediately since the wizard is a dialog,
the
+ // user can't access enabled buttons anyway.
+ DriftConfigurationView.this.refreshTableInfo();
}
private void delete(ListGridRecord[] records) {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
index c0ae2d7..72442eb 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
@@ -201,6 +201,9 @@ public class ResourceGroupListView extends
Table<ResourceGroupCompositeDataSourc
Permission.MANAGE_INVENTORY) {
public void executeAction(ListGridRecord[] selection, Object actionValue)
{
new GroupCreateWizard(ResourceGroupListView.this).startWizard();
+ // we can refresh the table buttons immediately since the wizard is a
dialog, the
+ // user can't access enabled buttons anyway.
+ ResourceGroupListView.this.refreshTableInfo();
}
});
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java
index 15ab3dc..beeb982 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java
@@ -152,6 +152,9 @@ public class ResourceCompositeSearchView extends ResourceSearchView {
public void executeAction(ListGridRecord[] selection, Object
actionValue) {
ResourceFactoryImportWizard.showImportWizard(parentResourceComposite.getResource(),
(ResourceType) actionValue);
+ // we can refresh the table buttons immediately since the wizard
is a dialog, the
+ // user can't access enabled buttons anyway.
+ ResourceCompositeSearchView.this.refreshTableInfo();
}
});
}
@@ -172,6 +175,9 @@ public class ResourceCompositeSearchView extends ResourceSearchView {
public void executeAction(ListGridRecord[] selection, Object
actionValue) {
ResourceFactoryCreateWizard.showCreateWizard(parentResourceComposite.getResource(),
(ResourceType) actionValue);
+ // we can refresh the table buttons immediately since the wizard
is a dialog, the
+ // user can't access enabled buttons anyway.
+ ResourceCompositeSearchView.this.refreshTableInfo();
}
});
}