如何禁用ValueBoxEditorDecorator <string>?</string>

时间:2012-03-07 03:56:01

标签: gwt gwt2 gwt-editors

我想要只读编辑器,所以我禁用它中的每个控件。但我不能用ValueBoxEditorDecorator做到这一点。你们有什么想法我可以禁用它吗?

课程中有ValueBoxBase<T> peer,但它显然是私密的。

1 个答案:

答案 0 :(得分:1)

我想我可以像这样添加内部小部件的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>

然后拨打cellPhoneNumberText.setEnable()

它唯一的缺点是我班上字段的额外定义,而且还必须用@Ignore这样的注释标记

@UiField
ValueBoxEditorDecorator<String> cellPhoneNumber;

@Ignore
@UiField
TextBox cellPhoneNumberText;