Closed frankstolle closed 7 years ago
Unfortunatelly, gwt-api-generator does not handle this kind of cases, it is difficult to handle in this project without introducing a hack for this case.
There are two options for you:
interface VGrid extends VaadinGridElement {
@JsFunction
interface ItemCallback {
void call(JavaScriptObject error, JavaScriptObject item);
}
@JsMethod
void getItem(double rowIndex, ItemCallback callback, boolean onlyCached);
}
((VGrid) grid.getPolymerElement()).getItem(idx, (err, item) -> { ... }, false);
Reopening since gwt-api-generator allows extending base classes with java code.
If I want to use grid.getItem(..) I have to define a callback-Method.
The callback of type function allows only one argument, but the grid expects two arguments. Here the type Function seems to be wrong and an individual type should be used. As workaround I have written a Wrapper, because extending Function is not possible:
The call is then: