bee7er
25 Aug 2009, 4:53 AM
Hi,
i am having trouble using the new setZIndex(..) method of Component in GXT 2.x.
I have a global filter panel which i always want to be visible amongst a number of different analytics modules on screen which are encapsulated in GXT Windows.
The code below represents the components of the GlobalFilterPanel which are basically a FormPanel inside a VerticalPanel:
public class GlobalFilterPanel extends LayoutContainer {
private VerticalPanel m_FilterPanel;
private FormPanel m_Form;
public GlobalFilterPanel(AnalyticsClientManager p_Manager) {
m_Manager = p_Manager;
m_GlobalFilters = m_Manager.getGlobalFilters();;
m_FilterPanel = new VerticalPanel();
m_FilterPanel.setSpacing(10);
m_FilterPanel.setPagePosition(0,110);
createForm();
m_FilterPanel.add(m_Form);
}
private void createForm() {
FormLayout formLayout = new FormLayout();
m_Form = new FormPanel();
m_Form.setLayout(formLayout);
m_Form.setHeading(TITLE);
m_Form.setFrame(true);
m_FilterPanel.setLayout(new FlowLayout());
m_FilterPanel.setBorders(false);
m_FilterPanel.setHeight(HEIGHT);
AnalyticsFilter displayStartDate = null;
AnalyticsFilter displayEndDate = null;
for (final AnalyticsFilter filter : m_GlobalFilters) {
// Create all dynamic filters
createEditableFilterWidget(filter);
// Identify the display start
// and end date filters
if (filter.getName().equals(DISPLAY_START_DATE_PARAM)) {
displayStartDate = filter;
}
else if (filter.getName().equals(DISPLAY_END_DATE_PARAM)) {
displayEndDate = filter;
}
}
// These fields read-only so not members
createReadOnlyTextField(RUN_START_DATE, displayStartDate);
createReadOnlyTextField(RUN_END_DATE, displayEndDate);
createRefreshButton();
}
/**
* Set the z-index of the global filter
* panel so that it is always on top.
*/
public void setOnTop() {
m_FilterPanel.setZIndex(99999999);
m_Form.setZIndex(99999999);
// setZIndex(99999999);
}
I am calling setOnTop() from a manager class after the component has been rendered via show() (i got an error when i tried to do this before it had been rendered).
However, the other GXT windows still hide the global filter panel when moved over it.
I also have a ToolBar at the bottom of the page. But when i call setZIndex directly on the GXT Toolbar, it works and is always visible when other GXT windows are moved over it:
public class ViewControllerPanel extends LayoutContainer {
private ToolBar m_Panel;
private Menu m_LayoutsMenu;
private MenuItem m_SwitchLayoutMenuItem;
private MenuItem m_DefaultLayoutMenuItem;
private MenuItem m_DeleteLayoutMenuItem;
private AnalyticsClientManager m_Manager;
public ViewControllerPanel(AnalyticsClientManager p_Manager) {
m_Manager = p_Manager;
createPanel();
}
/*
* Create the view toolbar panel.
*/
private void createPanel() {
m_Panel = new ToolBar();
m_Panel.setVisible(true);
m_Panel.addListener(Events.Resize, new Listener<ToolBarEvent> () {
public void handleEvent(ToolBarEvent p_Event) {
setToolBarPosition();
}
});
addModuleDefnItems();
addSeparator();
addUtilities();
addSeparator();
}
/**
* Set the z-index of the view controller
* panel so that it is always on top.
*/
public void setOnTop() {
m_Panel.setZIndex(999999999);
}
Can anyone point me in the right direction as to what i am doing wrong? Any help gratefully received.
cheers
Patrick
i am having trouble using the new setZIndex(..) method of Component in GXT 2.x.
I have a global filter panel which i always want to be visible amongst a number of different analytics modules on screen which are encapsulated in GXT Windows.
The code below represents the components of the GlobalFilterPanel which are basically a FormPanel inside a VerticalPanel:
public class GlobalFilterPanel extends LayoutContainer {
private VerticalPanel m_FilterPanel;
private FormPanel m_Form;
public GlobalFilterPanel(AnalyticsClientManager p_Manager) {
m_Manager = p_Manager;
m_GlobalFilters = m_Manager.getGlobalFilters();;
m_FilterPanel = new VerticalPanel();
m_FilterPanel.setSpacing(10);
m_FilterPanel.setPagePosition(0,110);
createForm();
m_FilterPanel.add(m_Form);
}
private void createForm() {
FormLayout formLayout = new FormLayout();
m_Form = new FormPanel();
m_Form.setLayout(formLayout);
m_Form.setHeading(TITLE);
m_Form.setFrame(true);
m_FilterPanel.setLayout(new FlowLayout());
m_FilterPanel.setBorders(false);
m_FilterPanel.setHeight(HEIGHT);
AnalyticsFilter displayStartDate = null;
AnalyticsFilter displayEndDate = null;
for (final AnalyticsFilter filter : m_GlobalFilters) {
// Create all dynamic filters
createEditableFilterWidget(filter);
// Identify the display start
// and end date filters
if (filter.getName().equals(DISPLAY_START_DATE_PARAM)) {
displayStartDate = filter;
}
else if (filter.getName().equals(DISPLAY_END_DATE_PARAM)) {
displayEndDate = filter;
}
}
// These fields read-only so not members
createReadOnlyTextField(RUN_START_DATE, displayStartDate);
createReadOnlyTextField(RUN_END_DATE, displayEndDate);
createRefreshButton();
}
/**
* Set the z-index of the global filter
* panel so that it is always on top.
*/
public void setOnTop() {
m_FilterPanel.setZIndex(99999999);
m_Form.setZIndex(99999999);
// setZIndex(99999999);
}
I am calling setOnTop() from a manager class after the component has been rendered via show() (i got an error when i tried to do this before it had been rendered).
However, the other GXT windows still hide the global filter panel when moved over it.
I also have a ToolBar at the bottom of the page. But when i call setZIndex directly on the GXT Toolbar, it works and is always visible when other GXT windows are moved over it:
public class ViewControllerPanel extends LayoutContainer {
private ToolBar m_Panel;
private Menu m_LayoutsMenu;
private MenuItem m_SwitchLayoutMenuItem;
private MenuItem m_DefaultLayoutMenuItem;
private MenuItem m_DeleteLayoutMenuItem;
private AnalyticsClientManager m_Manager;
public ViewControllerPanel(AnalyticsClientManager p_Manager) {
m_Manager = p_Manager;
createPanel();
}
/*
* Create the view toolbar panel.
*/
private void createPanel() {
m_Panel = new ToolBar();
m_Panel.setVisible(true);
m_Panel.addListener(Events.Resize, new Listener<ToolBarEvent> () {
public void handleEvent(ToolBarEvent p_Event) {
setToolBarPosition();
}
});
addModuleDefnItems();
addSeparator();
addUtilities();
addSeparator();
}
/**
* Set the z-index of the view controller
* panel so that it is always on top.
*/
public void setOnTop() {
m_Panel.setZIndex(999999999);
}
Can anyone point me in the right direction as to what i am doing wrong? Any help gratefully received.
cheers
Patrick