gpt4 book ai didi

gwt - 启用/禁用 MGWT 按钮

转载 作者:行者123 更新时间:2023-12-04 23:55:45 26 4
gpt4 key购买 nike

我是 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/其他东西实现上述功能

最佳答案

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

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

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

关于gwt - 启用/禁用 MGWT 按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16337279/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com