I've got several Layout components, added as tabs, in Vaadin that execute time-consuming operations to display some values. In order to minimize the computation time I'd like to execute the time-consuming operation only if the concerning panel/layout becomes visible. I've tried common event listeners but they didn't get fired. In Swing I'm used to react on such events. But how do you do it in Vaadin?
gridLayout.addComponentAttachListener(new ComponentAttachListener()
{
@Override
public void componentAttachedToContainer(
final ComponentAttachEvent event)
{
System.err.println("attach-listener-" + event);
}
});
gridLayout.addLayoutClickListener(new LayoutClickListener()
{
@Override
public void layoutClick(final LayoutClickEvent event)
{
System.err.println("layoutclick" + event);
}
});
It's important to realize a "lazy loading" for these UI container's content. I'm convinced that I'm not the only one that ever tried to realize this. What would be your approach?