Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gwt 如何禁用ValueBoxEditorDecorator<;字符串>;?_Gwt_Gwt2_Gwt Editors - Fatal编程技术网

Gwt 如何禁用ValueBoxEditorDecorator<;字符串>;?

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> <

我想要只读编辑器,所以我禁用其中的每个控件。但我不能用ValueBoxeditor或Decorator做这件事。你们有什么办法让我禁用它吗


类中有
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);}
,我在每个编辑器中都实现了它。你能提出比我在回答中描述的更优雅的解决方案吗?不,你的自我回答是正确的方法(对我来说)。你可以试着使用
编辑器或访问者
,但我不确定它是否值得这么复杂。