modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/AbstractTwoLevelTabSetView.java
| 22 ++++++----
1 file changed, 14 insertions(+), 8 deletions(-)
New commits:
commit 03ebe5d1e03ac836c8618df6761f248d3ef364a8
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Aug 29 12:48:40 2011 -0400
[BZ 733144 - links to non-default subtabs don't work]
The problem occurred, I believe, when you navigated from resource A,
default tab/subtab to resource A, non-default tab/subtab.
An easy example of this would be 1) Favorites Button->resources->A,
bringing you to A->Summary-Activity and then 2) Click on the alert def
name for a recent alert in the alerts portlet.
This scenario manged to generate a smartgwt tabbing event that did not play
well with others. As a response, I've expanded the net ignoring certain
smatgwt tabbing events to catch this as well. Tree/Tab/Subtab
nav should be well exercised (tree/context menu/tabs/subtabs) to ensure
thia change solves the problem without causing others.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/AbstractTwoLevelTabSetView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/AbstractTwoLevelTabSetView.java
index e580b9c..cade8fe 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/AbstractTwoLevelTabSetView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/AbstractTwoLevelTabSetView.java
@@ -201,15 +201,20 @@ public abstract class AbstractTwoLevelTabSetView<T, U extends
Layout> extends Lo
this.tabName = null;
}
+ // We are either navigating to a new detail view (new entity: resource or group)
or switching tabs
+ // for the current entity. Changing entities may change the available tabs as the
same tab set may not
+ // be supported by the new entity's type. To maintain a valid tab selection
for the TabSet, smartgwt will
+ // generate events if the current tab is removed (which can happen say, when
navigating from a resource of
+ // type A to a resource of type B). We need to ignore tab selection events
generated by smartgwt because we
+ // already perform explicit tab management at a higher level. To do this we
explicitly set events to be be
+ // ignored. We re-enable the event handling when safe. (see selectTab()).
Similarly, even when navigating
+ // within the same entity, when changing tabs we need to suppress smartgwt
generated tab events (when
+ // calling TabSet.selectTab). That event can conflict with our subtab management,
navigating the user
+ // to the default subtab for the tab and overriding our explicit navigation to a
non-default subtab.
+ this.tabSet.setIgnoreSelectEvents(true);
+
if (getSelectedItemId() == null || getSelectedItemId() != id) {
// A different entity (resource or group), load it and try to navigate to the
same tabs if possible.
- // Changing entities may change the available tabs as the same tab set may
not be supported by the
- // new entity's type. To maintain a valid tab selection for the TabSet,
smartgwt will generate an
- // events if the current tab is removed (which can happen say, when
navigating from a resource of type A
- // to a resource of type B). We need to ignore tab selection events generated
by smartgwt because we
- // handle this at a higher level. To do this we explicitly set events to be
be ignored. We re-enable
- // the event handling when safe. (see selectTab()).
- this.tabSet.setIgnoreSelectEvents(true);
this.loadSelectedItem(id, viewPath);
} else {
@@ -261,7 +266,8 @@ public abstract class AbstractTwoLevelTabSetView<T, U extends
Layout> extends Lo
// the requested tab/subtab are valid, continue with this path
- // select the tab and subTab (no event fired, we're already dealing with
the correct path)
+ // select the tab and subTab (we are suppressing event handling, so the
smartgwt fired event is ignored,
+ // alowing us to perform the desired subtab management below)
this.tabSet.selectTab(tab);
// this call adds the subtab canvas as a member of the subtablayout
// don't show the subtab canvas until after we perform any necessary
rendering.
Show replies by date