Monday, April 9, 2012

RequestFactory and ListDataProvider assign type Problem

Hello,

I'm trying to make a generic method to get some data with
RequestFactory.

I have a method getData that executes fire on a Request in order to
get a list of items(generics)

The problem is when I try to assign the returned List arg0 to my
ListDataProvider I get a type error.


private ListDataProvider<T> dataProvider;
.
.
.
.
public <T> void getData(Request<List<T>> specificRequest) {

specificRequest.fire(new Receiver<List<T>>() {
@Override
public void onSuccess(List<T> arg0) {

assignDataProvider(arg0);
}
});

return ;
}

public <T> void assignDataProvider(List<T> arg0) {

this.dataProvider.setList(arg0);
//The method setList(List<T>) in the type ListDataProvider<T> is not
applicable for the arguments (List<T>)

this.dataProvider= new ListDataProvider<T>(arg0);
//Type mismatch: cannot convert from
com.google.gwt.view.client.ListDataProvider<T> to
com.google.gwt.view.client.ListDataProvider<T>
}

How can I use the data I get from arg0 so I can assign it to my
ListDataProvider?

--
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