loading indicator

hi friends,
in my vaadin application i use buttons as links.
i write my codes which will be executed after clicking the link to the button’s click event (for ex, open another view etc.)
on some links after i click the link a loading indicator is shown on top right, and on some not.
i want loading indicator will be shown after clicking each link.
i’m wondering if i am doing something wrong against expected coding style.

sample code on which indicator is shown


Button link = new Button( "<< " + CommonUtils.getText( "Return to Dashboard" ), new Button.ClickListener(){

            private static final long serialVersionUID = 6809878497244086921L;

            @Override
            public void buttonClick( ClickEvent event ){
                mainWindow.removeAllComponents();
                mainWindow.addComponent( new Dashboard() );
            }
        } );
        link.setStyleName( BaseTheme.BUTTON_LINK );
        return link;

sample code on which indicator is not shown


Button link = new Button( "test" );
        link.setStyleName( BaseTheme.BUTTON_LINK );
        link.addListener( new Button.ClickListener(){

            @Override
            public void buttonClick( ClickEvent event ){
                mainWindow.removeAllComponents();
                mainWindow.addComponent( new Test() );

            }
        } );

thanks for your helps.

The indicator has a 300ms delay before it gets visible. So I think the Dashboard component just takes a while longer to build than then other Test component, making the loading indicator visible.

Thanks Jouni,
you’re right, i’ve found that reason, i was going to reply my question as solved, but i saw your reply :wink:
btw, is there a way to decrease that default 300ms waiting time (in other words is it configurable)?
thanks again.

i’ve found this topic (
http://vaadin.com/forum/-/message_boards/view_message/450939
)
so it is not configurable i think.
thanks anyway.

I don’t think Stefan created an enhancement request about this, so please
create one
- that way we might get around to looking into this at some point.