Monday, April 27, 2015

Resources as Array

I have a ClientBundle with a few TextRources like these here:

public interface MyResources extends ClientBundle {
  public static final MyResources INSTANCE =  GWT.create(MyResources.class);

  public TextResource text1();

  public TextResource text2();

Now I want to create an Array of the TextResource like this:

public class Sample {
   public static TextResource[] myTextRes = new TextResource[] {

But when I´m walking through the array with the following code I get an error message at runtime

for(int i=0; i < Samples.myTextRes .length; i++) {
        TextResource tr = Sample.myTextRes[i];                   

Uncaught ReferenceError: Lcom_google_gwt_resources_client_TextResource_2_classLit_0_g$ is not defined

What I´m doing wrong  ?

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment