Below is the code snippet to set the languages to set into a ListGrid
@Override
protected void onReveal() {
super.onReveal();
testService.getLanguages(new AsyncCallback<ArrayList<HashMap<String, Object>>>() {
@Override
public void onFailure(Throwable e) {
logger.log(Level.SEVERE, e.getMessage(), e);
}
@Override
public void onSuccess(ArrayList<HashMap<String, Object>> result) {
ListGridField[] gridFields = new ListGridField[1];
ListGridField field = new ListGridField("language");
field.setWidth(300);
gridFields[0] = field;
getView().getGrid().setFields(gridFields);//Giving NullPointerException
getView().getGrid().setDataAsMap(result);
}
});
getView().getBtnCancel().focus();
}
In above method i am getting NullPointerException & InvalidTargetInvocation exception while setting the values to the ListGrid using "setFields(gridFields)"
gridFields is having the values to be set.
It was working fine with GWT-2.4.0 & smartgwt-3.0,after upgrading the versions to gwt-2.6.1 & smartgwt-4.1 its causing the problem.
Please help.
@Override
protected void onReveal() {
super.onReveal();
testService.getLanguages(new AsyncCallback<ArrayList<HashMap<String, Object>>>() {
@Override
public void onFailure(Throwable e) {
logger.log(Level.SEVERE, e.getMessage(), e);
}
@Override
public void onSuccess(ArrayList<HashMap<String, Object>> result) {
ListGridField[] gridFields = new ListGridField[1];
ListGridField field = new ListGridField("language");
field.setWidth(300);
gridFields[0] = field;
getView().getGrid().setFields(gridFields);//Giving NullPointerException
getView().getGrid().setDataAsMap(result);
}
});
getView().getBtnCancel().focus();
}
In above method i am getting NullPointerException & InvalidTargetInvocation exception while setting the values to the ListGrid using "setFields(gridFields)"
gridFields is having the values to be set.
It was working fine with GWT-2.4.0 & smartgwt-3.0,after upgrading the versions to gwt-2.6.1 & smartgwt-4.1 its causing the problem.
Please help.
Comment