Unable to get reference of child components in Custom Component Container w

Hello,
I am trying to create a custom component container widget based on ‘https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20simple%20component%20container’. And what I needed in the Widget side is to traverse through the child components, I’m overriding add(Widget w) method at client side.

public class MyComponentContainerWidget extends FlowPanel {

//This code is incomplete, but to specify my issue.

    @Override
    public void add(Widget widget) {
        super.add(widget);
        if (widget instanceof VAbstractOrderedLayout) {
            VAbstractOrderedLayout abstractLayout = (VAbstractOrderedLayout) widget;
            int count = abstractLayout.getWidgetCount();
        }
    }
}

Here I am adding a VerticalLayout with some components added to it, at server side, and when I tried to check the “count” here in the client side(aboe code), it seems to be 0 always. So I hope either this is not the right way or some bug is there. Anybody please give me an idea for this?

Basically when I add more components(VerticalLayouts), then I’m missing the last added componets children only, so I hope it’s an init problem in case adding a new component, as for the other components which are already added, I’m getting the children. So can anybody suuggest which is the correct place to search for children?