【发布时间】:2013-01-10 10:08:57
【问题描述】:
我正在尝试将 ID 添加到 GWT 元素。我试过下面的代码。
在SubscribeView.java 文件中,定义了existingFundRadioButton 字段,我为它设置了一个ID,如下所示:
DOM.setElementAttribute( existingFundRadioButton.getElement(),
"ID",
"existingFundRadioButton" )
我尝试使用existingFundRadioButton.getElement().setId("existingFundRadioButton"),但它不起作用。
这是我的代码。
<g:FlowPanel width="100%">
<g:FlowPanel>
<g:HTMLPanel ui:field='searchPanel' styleName="{res.fdcWidgets.box}">
<table class="{res.fdcWidgets.inputTable}">
<colgroup>
<col width="25%" />
<col width="75%" />
</colgroup>
<tbody>
<tr>
<td>
<fdc:I18NRadioButton name="fund"
ui:field="existingFundRadioButton" checked="true"
messageKey="buy.existingFundLabel" />
</td>
<td>
<hli:HoldingsListBoxWidget ui:field="holdingsListBox" />
</td>
</tr>
</tbody>
</table>
</g:HTMLPanel>
</g:FlowPanel>
<g:FlowPanel styleName="{res.fdcWidgets.contentRightColumn}">
<fund:FundInformationWidget ui:field="fundInformationWidget" />
</g:FlowPanel>
</g:FlowPanel>
【问题讨论】:
-
如果通过选择答案或发布您自己的答案得到解决,最好关闭问题。如果问题没有被关闭,Stackoverflow 将不会有这么大的帮助!!!