Thursday, January 13, 2011

how to inject ClientBundle using GIN to avoid GWT.create

given we have a client bundle:
public interface MyResource extends ClientBundle {}

in our widget:

public class MyWidget extends Composite {

MyResource resource = GWT.create(MyResource.class);

// resource.myresource

how can we inject ClientBundle, so that we can do away with GWT.create

for example:

private final MyResource resource;

@Inject
public MyWidget(MyResource resource){

this.resource = resource;
}

when I try this, I get exceptions.
do I need to declare any bindings in gin module config ?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate