Problem with layouts in generated colum


I have problem with components (mostly labels) set into layout, which are placed into generated column of table.

Code below setup two tables, first one works properly, while second has height calculation problem.

Note: Both tables has minor height calculation issue, which can be solved by setting label css properties to:

padding-top: 0px;
padding-bottom: 0px;

First table works properly because its first column is regular (not generated).
Second one has height calculation issue because it only has generated columns, and one of its columns has
layout which width has been set to 100% width (has to be set to get components aligned).
Second table would work like first, if layout in last column would not have setWidth(“100%”).

public class Application extends com.itmill.toolkit.Application{

	public void init() {
		    Window main = new Window("Generated column / Layout test");

	        VerticalLayout baseLayout = new VerticalLayout();

	        Table table1 = initTable(10, false);
	        baseLayout.addComponent(new Label("Table with one regular field instart of table and two generated fields."));

	        Table table2 = initTable(10, true);
	        baseLayout.addComponent(new Label("Table with oly generated fields."));


		}catch(Exception e){

	private Table initTable(int pageLength, boolean firstColumnIsGenerated){
		Table table = new Table();


			table.setColumnHeader("firstname", "FirstName");
			table.addGeneratedColumn("firstname", new LayoutColumnGenerator(new String[]{"firstname"}));
		table.addGeneratedColumn("lastname", new LayoutColumnGenerator(new String[]{"lastname"}));
		table.addGeneratedColumn("whole name", new LayoutColumnGenerator(new String[]{"firstname", "lastname"}));

		return table;

	private Container createDemoData(int pageLength){
		List<Data> dataList = new ArrayList<Data>();
		for(int i=0; i<pageLength; i++){
			dataList.add(new Data("Firstname"+i, "Lastname"+i));
		BeanArrayContainer bac = new BeanArrayContainer(dataList);
		return bac;
	public class Data {
		private String firstname;
		private String lastname;
		public Data(String firstname, String lastname) {
			this.firstname = firstname;
			this.lastname = lastname;
		public String getFirstname() {
			return firstname;
		public String getLastname() {
			return lastname;

	public class LayoutColumnGenerator implements ColumnGenerator {

		private String[] fields;
		public LayoutColumnGenerator(String[] fields){
			this.fields = fields;

		public Component generateCell(Table source, Object itemId, Object columnId) {
			Item item = source.getItem(itemId);
			HorizontalLayout layout = new HorizontalLayout();
			for(String field : fields){
				String fieldData = (String)item.getItemProperty(field).getValue();
				Label fieldLabel = new Label(fieldData);
				if(fields.length > 1){
					layout.setComponentAlignment(fieldLabel, Alignment.TOP_CENTER);
			return layout; 

This issue was fixed 3 weeks ago ( but it seems it’s not in any official builds.
Artur or Magi, what is the schedule for 5.3.1?

We are currently finalizing 5.3.1 and it is scheduled to be released next week.