PDA

View Full Version : ToolBar in AccordionLayout



elSusto
6 Jan 2010, 6:53 AM
Hey,

I have a Panel with an Accordion Layout

and in a Panel in the AccordionLayout i will add a toolBar

the toolbar will shown but the buttons i added to the toolbar will not show.

when i add the panel with the toolbar not to the accordion layout but to a other panel it works fine.



public class MyPanel extends ContentPanel{

public MyPanel() {
super();

Button item = new Button("bla");
item.addSelectionListener(new SelectionListener<ButtonEvent>() {

@Override

public void componentSelected(ButtonEvent ce) {
// do something

}
});
item.setIcon(Resource.ICONS.newFolder());
item.setToolTip("create");
toolBar.add(item);


item = new Button();
item.setIcon(Resource.ICONS.newConf());
item.setToolTip("create a new ...");
toolBar.add(item);

toolBar.add(new SeparatorToolItem());
this.setBottomComponent(toolBar);
}
}



The Accordion




public class MyNavigation extends ContentPanel{

public MyNavigation() {
super(new AccordionLayout());
add(new MyPanel());
}
}




so it doesn't works

but if i delete the accordion layout



public class MyNavigation extends ContentPanel{

public MyNavigation() {
super(new FitLayout());
add(new MyPanel());
}
}



so it works fine and the toolbar will shown correctly.

any ideas?

Tranquiliser
6 Jan 2010, 7:39 PM
Try disabling overflow of the toolbar.

elSusto
7 Jan 2010, 12:23 AM
Thanks,

so i can add buttons with text, but when i add a button with only an image the button will shown but the image not.

when i add it to a other panel, than the accordion the image will shown correctly.