Gwt 如何禁用ValueBoxEditorDecorator<;字符串>;?
我想要只读编辑器,所以我禁用其中的每个控件。但我不能用ValueBoxeditor或Decorator做这件事。你们有什么办法让我禁用它吗Gwt 如何禁用ValueBoxEditorDecorator<;字符串>;?,gwt,gwt2,gwt-editors,Gwt,Gwt2,Gwt Editors,我想要只读编辑器,所以我禁用其中的每个控件。但我不能用ValueBoxeditor或Decorator做这件事。你们有什么办法让我禁用它吗 类中有ValueBoxBase peer,但它显然是私有的。我想我可以像这样向内部小部件添加ID <e:ValueBoxEditorDecorator ui:field="cellPhoneNumber" stylePrimaryName="{style.forform}"> <e:valuebox> <
类中有
ValueBoxBase peer
,但它显然是私有的。我想我可以像这样向内部小部件添加ID
<e:ValueBoxEditorDecorator ui:field="cellPhoneNumber" stylePrimaryName="{style.forform}">
<e:valuebox>
<g:TextBox ui:field="cellPhoneNumberText" width="100%" stylePrimaryName="{style.forform}"/>
</e:valuebox>
</e:ValueBoxEditorDecorator>
@UiField
ValueBoxEditorDecorator<String> cellPhoneNumber;
@Ignore
@UiField
TextBox cellPhoneNumberText;
这在很大程度上取决于您如何迭代子编辑器。我手动迭代它们。我添加了
public interface enablable{void setEnable(boolean enable);}
,我在每个编辑器中都实现了它。你能提出比我在回答中描述的更优雅的解决方案吗?不,你的自我回答是正确的方法(对我来说)。你可以试着使用编辑器或访问者
,但我不确定它是否值得这么复杂。