How can set Element Id for a image which is accessed using ClientBundle in GWT?

StackOverflow https://stackoverflow.com/questions/11879606

  •  25-06-2021
  •  | 
  •  

سؤال

In GWT, I need to set element id for a image which will be accessed using ClientBundle.

For eg. @Source("logo.png")

     ImageResource logo();

Instead of Image I'm calling this logo(). But I want to set element Id for logo.png.

Is it possible?

هل كانت مفيدة؟

المحلول

Resources resources = GWT.create(Resources.class);
Image img = new Image(resources.logo());
img.getElement().setID("ID");

Is it what you want ?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top