Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    after GWT upgarde setFields() givig NullPointerException

    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.


    #2
    You need to post the actual exception. Please review the FAQ for other information to include, such as the contents of the SmartGWT Developer Console.

    Comment

    Working...
    X