Gwt google web toolkit在图像中添加alt attrib

Gwt google web toolkit在图像中添加alt attrib,gwt,imagebutton,alt,Gwt,Imagebutton,Alt,嗨,我有一个有箭头的图像。我想添加“alt”属性 这是我的班级: public interface DisclosurePanelArrows extends ClientBundle { public static final DisclosurePanelArrows INSTANCE = GWT.create(DisclosurePanelArrows.class); @Source("disclosurePanelClosed.png") ImageResou

嗨,我有一个有箭头的图像。我想添加“alt”属性

这是我的班级:

public interface DisclosurePanelArrows extends ClientBundle
{

    public static final DisclosurePanelArrows INSTANCE = GWT.create(DisclosurePanelArrows.class);

    @Source("disclosurePanelClosed.png")
    ImageResource disclosurePanelClosed();


    @Source("disclosurePanelOpen.png")
    ImageResource disclosurePanelOpen();

}
我在这里用过:(不工作)

我注意到HTML标记是通过编程创建的,并在.gwtml文件中生成

我发现唯一链接到它的js是WAR文件夹中的这个,所以我不确定

function com_irondata_icmcase_ICMCase(){var O='',vb='" for "gwt:onLoadErrorFn"',tb='" for "gwt:onPropertyErrorFn"',hb='"><\/script>',Y='#',cc='../css/ICMCase.css',dc='../css/dummy.css',bc='../css/theme.css',Wb='.cache.html',$='/',Rb='3A2B8EBB69B48C7A8A7573A74E0C6812',Sb='59203CCA1EBBD79FD6BB80354E15F64D',Vb=':',nb='::',kc='<script defer="defer">com_irondata_icmcase_ICMCase.onInjectionDone(\'com.irondata.icmcase.ICMCase\')<\/script>',gb='<script id="',gc='<script language="javascript" src="',qb='=',Z='?',Eb='ActiveXObject',sb='Bad handler "',Tb='C3CB1347D72F2C0FB0DF18AB080081C2',Fb='ChromeTab.ChromeFrame',Ub='DDDD212960179CCBED9A98B8863C29E1',ec='DOMContentLoaded',ib='SCRIPT',fb='__gwt_marker_com.irondata.icmcase.ICMCase',jb='base',bb='baseUrl',S='begin',R='bootstrap',Db='chromeframe',ab='clear.cache.gif',P='com.irondata.icmcase.ICMCase',db='com.irondata.icmcase.ICMCase.nocache.js',mb='com.irondata.icmcase.ICMCase::',pb='content',X='end',Lb='gecko',Mb='gecko1_8',T='gwt.codesvr=',U='gwt.hosted=',V='gwt.hybrid',Xb='gwt/chrome/chrome.css',ub='gwt:onLoadErrorFn',rb='gwt:onPropertyErrorFn',ob='gwt:property',ac='head',Pb='hosted.html?com_irondata_icmcase_ICMCase',_b='href',Kb='ie6',Jb='ie8',Ib='ie9',wb='iframe',_='img',xb="javascript:''",fc='js/amathcontext.js',hc='js/amathcontext.js"><\/script>',ic='js/bigdecimal.js',jc='js/bigdecimal.js"><\/script>',Yb='link',Ob='loadExternalRefs',kb='meta',zb='moduleRequested',W='moduleStartup',Hb='msie',lb='name',Bb='opera',yb='position:absolute;width:0;height:0;border:none;alt=""',Zb='rel',Gb='safari',cb='script',Qb='selectingPermutation',Q='startup',$b='stylesheet',eb='undefined',Nb='unknown',Ab='user.agent',Cb='webkit';var l=window,m=document,n=l.__gwtStatsEvent?function(a){return l.__gwtStatsEvent(a)}:null,o=l.__gwtStatsSessionId?l.__gwtStatsSessionId:null,p,q,r,s=O,t={},u=[],v=[],w=[],x=0,y,z;n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:R,millis:(new Date).getTime(),type:S});if(!l.__gwt_stylesLoaded){l.__gwt_stylesLoaded={}}if(!l.__gwt_scriptsLoaded){l.__gwt_scriptsLoaded={}}function A(){var b=false;try{var c=l.location.search;return (c.indexOf(T)!=-1||(c.indexOf(U)!=-1||l.external&&l.external.gwtOnLoad))&&c.indexOf(V)==-1}catch(a){}A=function(){return b};return b}
函数com_ironda_icmcase_icmcase(){var O='',vb=''表示“gwt:onLoadErrorFn”,tb=''表示“gwt:onPropertyErrorFn”,hb=''“>'、Y='#'、cc='../css/ICMCase.css',dc='../css/dummy.css',bc='../css/theme.css',Wb='.cache.html'、$='/'、Rb='3A2B8EBB69B48C7A8A7573A74E0C6812',Sb='59203CCA1EBD79FD6BBB80354E15F64D',Vb=':'、nb=':'、nb=':'、ICMU irondata'ICMU-ICMU-ICMU-ICMU-Case.onjDone(\'com.ICMU、ICMU BigJS='BigJS='“>”,Yb='link',Ob='loadExternalRefs',kb='meta',zb='moduleRequested',W='moduleStartup',Hb='msie',lb='name',Bb='opera',Yb='位置:绝对;宽度:0;高度:0;边框:无;alt=”“,Zb='rel',Gb='safari',cb='script',Qb='selectingPermutation',Q='startup',$b='stylesheet',eb='undefined',Nb='unknown',Ab='user.agent',cb='webkit';var l=window,m=document,n=l.。u gwtStatsEvent?函数(a){return l.u gwtStatsEvent(a)}:null,o=l.u gwtstatsessionid?l.u gwtsessionid?l.'gwtstatsessionid:null,p,Q,r,s=o,t=[],t=[],[],[],[],[],[]n=0,x=n,n([模块化:P,会话:o,子系统:Q,子系统:Q,evtGroup:R,米利斯:(新日期)。getTime(),类型:S};P,P,P,P,P,P,P,SeseseseD:o,子系统:o,子系统:o,子系统:Q,子系统:Q,EVTTTG,子系统:o,子系统:o,子系统:o,子系统:Q,子系统:o,子系统:o,子系统:o,子系统:o,子系统:o,子系统:Q,子系统:o,子系统:o,子系统:o,子系统:Q,子系统:Q,子系统:Q,子系统:Q,EVTTTTTTTT,子系统:Q,子系统:Q,子系统:Q,子系统:Q,EVT,EVT,EVT,EVT组:R,子系统:R,子系统:R,EVT组:R,子系统:R&&l.external.gwtOnLoad))&&c.indexOf(V)==-1}catch(A){A=函数(){return b};return b}
我也试过了,但是它把alt放在了diff标签中


有什么建议吗?谢谢。

我找到了。经过8个多小时的努力,答案如下

 protected DisclosurePanel         disclosurePanel;

  if(disclosurePanel.getElement().hasChildNodes()) 
        { 
            NodeList<com.google.gwt.dom.client.Element> imgs =  disclosurePanel.getElement().getElementsByTagName("img");
            com.google.gwt.dom.client.Element elem = imgs.getItem(0);
            elem.setAttribute("alt", " ");
        }
受保护的披露面板披露面板;
if(dispositionPanel.getElement().hasChildNodes())
{ 
NodeList imgs=dispositionpanel.getElement().getElementsByTagName(“img”);
com.google.gwt.dom.client.Element elem=imgs.getItem(0);
元素setAttribute(“alt”,“”);
}

假设
icmage
是一种
com.google.gwt.user.client.ui.Image
,那么呢

否则,请显示
icmage
的代码,因为您没有显示如何使用
ImageResource

 protected DisclosurePanel         disclosurePanel;

  if(disclosurePanel.getElement().hasChildNodes()) 
        { 
            NodeList<com.google.gwt.dom.client.Element> imgs =  disclosurePanel.getElement().getElementsByTagName("img");
            com.google.gwt.dom.client.Element elem = imgs.getItem(0);
            elem.setAttribute("alt", " ");
        }