now it is working nearly perfect - only some raw type warnings remain - how to get rid of them? my signature look now like this:
private class LoadMaps<T extends Map> implements AsyncCallback<T> .... i get 2 raw type warnings - one in signature. this one i can eliminate by adding Map<?,?> but then "target.putAll(result)" isn't working anymore. so how to distribute <?> correctly? On 11 Apr., 14:00, tanteanni <tantea...@hotmail.com> wrote: > i am fairly new to gwt and struggling some how on "correct"/"nice" RPC > implementation (it is working but code becomes ugly). On my first GWT > based apps i often load some lists/data from db into front end. (Lists > to be used in combo boxes for instance). > > so if i have a widget that needs 3 different lists (probably > List<String> or Map<String, String>) i specify a service-method for > each list. the problem is to load all those lists, i have to implement > one class (...implements AsyncCallback) for each list. > but the only difference between this implementations is that they load > the result in different lists: > public void onSuccess(){ > list1 = result > > } > > so how to implement an abstract callback class that could load its > "result" into a given list/object (- a field of mother class) > > (if "call by reference" would exist in java i would giv "list1" as an > parameter for constructor and onSucces would load the result into this > reference?!) > > an optimal implementation would be if the result type could be a > generic type: A class lie this: > > class GeneralCallback<T> implements AsyncCallback<T>{ > public GeneralCallback(T target){ > ... > > } > > public onSuccess(T result){ > target = result; > > } > } > > is it possible to get such an abstract callback class? -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.