【问题标题】:Enabling/Disabling MGWT Button启用/禁用 MGWT 按钮
【发布时间】:2013-05-02 11:46:53
【问题描述】:

我是 GWT 和 MGWT 的初学者。在我的项目中,我有一个必须启用的要求 并禁用 MGWT 按钮。当前版本的 MGWT 中没有给出直接方法。 我在 GWT 按钮中看到过。

com.google.gwt.user.client.ui.Button b = new com.google.gwt.user.client.ui.Button();
b.setEnable(boolean);

但在 MGWT 中没有给出。 请帮助我,我们如何使用 CSS/其他东西来实现上述功能

【问题讨论】:

    标签: gwt button mgwt


    【解决方案1】:

    我不是 MGWT 人。并且必须有一些更好的解决方案。您可以尝试低级元素操作:

    Button mgwtButton;
    mgwtButton.getElement().setAttribute("disabled", "disabled");
    

    如果您采用此解决方案,最好稍后准备您的CustomButton,该CustomButton 使用额外的setEnabled(boolean enabled) 方法扩展MGWT 按钮以获得更好的API。

    【讨论】:

    • 以上只适用于GWT按钮。我试过MGWT按钮,但它不起作用
    • 是的,MGWT按钮是一个普通的div,不是输入,所以你需要做一些CSS调整,然后禁用相应的点击动作...
    猜你喜欢
    • 2012-02-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多