component size in layout

Hi:

I have a Component in a VerticalLayout that is wider than the layout width. To be able to view the component, I changed the verticalLayout for a Panel, in order to scroll and see all the component. Now, I can only see the component after resizing the layout, and I don’t get the scrollbar, so the component is cut…

What can I do to solve this?..the component is a visualizations add-on’ org chart…

here is the code I use after I create the org chart

layout.removeAllComponents(); //layout is a vertical layout
		    menu=new MenuBar();
		    menu.addItem("Organizational Chart", null);
		    menu.setWidth("100%");
		    menu.setHeight("18px");  // I use a menu bar as layout header (this works perfect)
		    layout2.setScrollable(true); //layout2 is a panel, previously it was a vertical layout
		    layout2.removeAllComponents();
		    layout.addComponent(menu);
		    layout.addComponent(layout2);
		    layout.setSizeFull();
		    layout.setExpandRatio(layout2, 1.0f);
			
		    layout2.addComponent(oc); //oc is the organizational chart
		    oc.setSizeFull();
		    layout2.setSizeFull();

thanks!!!

Hi:

Any ideas on this?..

thanks!!!

Hi:

Anything on this???

VerticalLayout has by default a 100% width, so using layout2.getContent().setSizeUndefined(); should enable the scrollbars.