I need to load an image without knowing if the image is available. Specifically, I load an image by some ID (eg. 123.png), but only certain ID's have the images.
One solution which seems pretty straightforward is to set the onerror event on the <img> tag. If it fires, set the URL of the image to something static, eg. no_image.png.
I know how to do this with HTML/JavaScript, but I have no idea how to do it with com.smartgwt.client.widgets.Img. How to add the error event listener?