Change widget content after login

hello All,

I have an area (Canvas) on screen, which has a LoginForm default. When a user logins, I need to change its content to UserInfoPanel.
LoginPanel is extends VLayout, and UserInfoPanel is a Canvas.

at loginSucces here is an eventhandler:

    /**
     *
     * @param event
     */
    public void process(SettingsEvent event) {
        if (loginArea == null)
            return;
        this.loginArea.removeFromParent();
        this.loginArea = createLoginArea();
        header.addMember(loginArea);
        this.loginArea.draw();
    }

   protected Canvas createLoginArea() {
        if (ClientSettings.getInstance().isAnonymous()) 
            return new LoginPanel();
        else 
            return this.owner.getUserInfoPanel();
    }

but it doesn’t changed.
What is the correct method to change the content of a widget?

thx,
Zamek

Why don’t change the area of the screen from Canvas to say VLayout and add the 2 widgets (loginForm and userPanel) using the addMember() on VLayout.
When you do that, just do userInfoPanel.hide();
after login just call LoginForm.hide(); and userInfoPanel.show();

Mihai are you using smart gwt or smart gwt ee and with what app server?

does it matter for this issue?
I am using smartgwt only.
As long as the login data is passed to server using an http get with params (username, password) in URL it does not matter what the application server.

Yes i know that it doesn’t matter, but wanted to know.

Apologies.

show/hide

ohh, its good idea and works.

thx a lot