Please help me out,
I am using Vaadin’s GridLayout inside a for loop like
for (int i = 0; i < SubjectLength; i++)
{
GridLayout tableHeader= new GridLayout(3,1);
tableHeader.addComponent(TopicTitle);
tableHeader.addComponent(MinHr);
tableHeader.addComponent(Streams);
tableHeader.setWidth("300px");
tableHeader.addStyleName(TABLEHEADER_STYLE);
}
The problem is that multiple addition of GridLayout ends in adding gridLayout at the last value of loop.But if i try to do System.out.println(“print”)
It result in printing correct number of print value.
What should i do in order to add multiple GridLayout?
You can’t add the same component more than once in a layout. You’ll have to create new instances of TopicTitle, MinHr and Streams.