PDA

View Full Version : Toolbar as TopComponent Problem



FireGlow
1 Feb 2010, 5:21 AM
Hey folks,

I have a problem with a toolbar that is at the end of the following hirarchy.

It adds my buttons as a kind menu point, instead of just adding the buttons in a normal way.

GXT 2.1.x
GWT 1.7.0

(Problem didn't exist with GXT 2.0.1)



ViewPort
|--LayoutContainer 1
|--LayoutContainer 2
|--TabPanel 1
|--TabItem 1
|--LayoutContainer 3
|--ContentPanel 1
|--FormPanel 1
|--ContentPanel 2
|--ToolBar
|--Button
|--Button
|--Button
The same toolbar works in other Panels, but not as a TopComponent of ContentPanel 2.

The Code how I add the toolbar is the following snipt:



toolbar = new ToolBar();

EHRflexToolItem addButton = new EHRflexToolItem("Add", "icon-action-grid-add", true);
addButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
Dispatcher.get().forwardEvent(new EHRflexEvent(EHRflexEventType.MEDICAL_DATA_GRID_ADD, shownGrid));
}
});
addButton.setTitle("Add");

EHRflexToolItem editButton = new EHRflexToolItem("Edit", "icon-action-grid-edit", true);
editButton.setTitle("Edit");
editButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
Dispatcher.get().forwardEvent(new EHRflexEvent(EHRflexEventType.MEDICAL_DATA_GRID_EDIT, shownGrid));
}
});

EHRflexToolItem deleteButton = new EHRflexToolItem("Delete", "icon-action-grid-delete", true);
deleteButton.setTitle("Delete");
deleteButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
Dispatcher.get().forwardEvent(new EHRflexEvent(EHRflexEventType.MEDICAL_DATA_GRID_DELETE, shownGrid));
}
});

toolbar.add(addButton);
toolbar.add(new SeparatorToolItem());
toolbar.add(editButton);
toolbar.add(new SeparatorToolItem());
toolbar.add(deleteButton);
toolbar.setAlignment(HorizontalAlignment.LEFT);
toolbar.layout();
Any ideas why the toolbar works on other places fine and here not ? Anyone met the problem already that the toolbar creates a menu point instead of showing the buttons in a line?

Thanks for any help

Anton

Arno.Nyhm
3 Feb 2010, 8:52 AM
its the same like here?
http://www.extjs.com/forum/showthread.php?p=429397#post429397

FireGlow
3 Feb 2010, 8:57 AM
yep , thanks. The second picture of the thread is showing the same problem. I didn't find the topic after searching for toolbar problem :)

So it is a bug of this current version. Ok. Waiting for the fix. Is maybe already the fix in SVN?

micgala
4 Feb 2010, 12:50 AM
You may want to try it out on 2.1.1... I guess it was fixed with it.

FireGlow
4 Feb 2010, 12:54 AM
Hey,

no I have tested the beta of 2.1.1 and there it wasn't.

micgala
4 Feb 2010, 12:59 AM
Maybe in the final one?

FireGlow
4 Feb 2010, 1:03 AM
I installed right now the 2.1.1, but unfortunatelly the problem still exists.

I hope this shouldn't be the fix?:

[89252]Issue with ToolBarLayout which is resized while not visible.

The strange part is, that it works on the top level, but if I add the toolbar deep in a hirarchy of Components, it acts strange.