SmartGWT Dialog title not set correctly

2019-02-28 10:28发布

I have a custom dialog that extends the SmartGWT dialog. My problem is that the title and the close button of the dialog aren't displayed in the dialog's title but in the dialog's content under all other elements.

Here is a screeshot:

Incorrect title placement

The bold test and the x button should be in the dialog's title.

My code basically is:

public class MyDialog extends Dialog {    

    public MyDialog() {       
        super();

        this.setTitle("test");

        this.setShowTitle(true);
        this.setShowCloseButton(true);
        this.setShowMaximizeButton(false);
        this.setShowMaximizeButton(false);
        this.setShowStatusBar(false);           
        this.setShowShadow(true);

        this.setWidth("500px");
        this.setHeight("300px");            
    }

    @Override
    protected void onInit() {

        Label lab =  new Label("test");
        this.addMember(lab);
    }
}

Is this a bug in SmartGWT or am I missing something? How can I place the title correctly?

Thanks for any help!

1条回答
兄弟一词,经得起流年.
2楼-- · 2019-02-28 11:03

There is a problem with your code. You've used

this.addMember(lab);

instead of

this.addItem(lab);
查看更多
登录 后发表回答