I add an onclic event in a com.google.gwt.dom.client.ImageElement using
imageElement.setAttribute(“onclick”,”var tabla=document.getElementById(‘tablaWidget’);var length=tabla.rows.length; for(var i=0;i
This works in firefox but not in IE.
I read here: onclick setAttribute workaround for IE7 that I shouldn’t use setAttribute to do this because is not crossbrowser, but I don`t know how to do it because this element doesn´t have the onclick or addEventListener method.
Thanks for your help.
You should use com.google.gwt.user.client.ui.Image instead of com.google.gwt.dom.client.ImageElement for any images that will be used in the UI. Then you can use Image#addClickHandler to handle clicks in a cross-browser compatible manner.