Accordion css style problem

Hi,

I am having problem setting up a custom css style for accordion’s tabs.
Here is a simple app demonstrating the problem:


public class AccordiontestApplication extends Application {

	@Override
	public void init() {
		
		Window mainWindow = new Window("Accordion Test Application");
		
		Accordion leftMenu = new Accordion();
		leftMenu.setWidth("200px");
		leftMenu.setHeight("100.0%");
		leftMenu.setImmediate(true);
		
		VerticalLayout vl = new VerticalLayout();
		vl.addComponent(new Label("Some text ..."));
		
		
		Tab tab = leftMenu.addTab(vl);
		tab.setStyleName("secretstyle");
		tab.setCaption("My Tab");
		
		VerticalLayout mainLayout = new VerticalLayout();
		mainLayout.setSizeFull();
		mainLayout.setMargin(true);
		mainLayout.setSpacing(true);
		mainLayout.addComponent(leftMenu);
		
		mainWindow.addComponent(mainLayout);
		setMainWindow(mainWindow);
	}

}

Checked 6.8.9 and 7.0.4 - in both cases the the css class doesn’t get attached at all on generated HTML.
Interestingly enough - when you query for the style (getStyleName()) - it does return the proper string.

Am I doing something wrong here ? Basically I need a simple way of getting accordion’s tabs using single
class names for testing purposes (selenium).

Many thanks,
Adrian

Hi,

seems to me that this is indeed a bug that affects both TabSheet and Accordion in both Vaadin 6 and 7. The tab style name is properly sent to the client, but nothing is done with it - so no wonder it does not end up in the rendered result.

Please file a ticket about this in the vaadin trac.

-tepi