启用/禁用gwt spanelement

问题描述

如何以编程方式启用/禁用com.google.gwt.dom.client.SpanElement 我需要像setEnabled(boolean enabled)和isEnabled()之类的方法; SpanElement不公开那些。 而且如果有人可以解释我使用spanelement那就太好了 @H_404_1@<g:HTMLPanel ui:field=\"container\"> <div class=\"{style.column}\"> <g:CheckBox ui:field=\"pendingBillingCheckBox\"></g:CheckBox><br clear=\"all\" /> <span class=\"{baseCSS.getApplicationCSS.label}\">Tech $:</span> <span class=\"{baseCSS.getApplicationCSS.label}\" ui:field=\"techCost\"></span><br clear=\"all\" /> <span class=\"{baseCSS.getApplicationCSS.label}\">Prof $:</span> <span class=\"{baseCSS.getApplicationCSS.label}\" ui:field=\"prof\"></span><br clear=\"all\" /> <g:TextBox addStyleNames=\"{style.profText}\"></g:TextBox> </div> </g:HTMLPanel> 我想启用/禁用techCost和prof UI字段 谢谢     

解决方法

尝试:
spanElement.getStyle().setDisplay(Style.Display.NONE);