Css not applied to component added to CssLayout

I have a problem adding components to a CssLayout dynamicly in vaadin. The last one added does not get the css attachted wich is deliverd by the String getCss(Component c) method. I use vaadin 6.
Here is an example of my code:

final CssLayout layout = new CssLayout()

 protected String getCss(Component c)
    return "display: inline-block";
  Button buttonA = new Button("Click Me!");

  buttonA.addListener(new ClickListener()
 public void buttonClick(ClickEvent event)
    Label label = new Label("Clicked " + i);
    i = i + 1;

[/code]Everytime i press the button the new label does not have the syle display: inline-block, but all the previous created ones have.

What am I doing wrong?



I just tested it using Vaadin 7.2.3 and it seems to work totally fine. What Vaadin version are you using?
Maybe in your version there is a problem which requires another server round-trip to update the client css…