Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8987869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:53:38+00:00 2026-06-15T21:53:38+00:00

GWT 2.5.0 A simple case using ListEditor failed below, what did i miss? public

  • 0

GWT 2.5.0

A simple case using ListEditor failed below, what did i miss?

public class OneBean {

    private String name;

    public OneBean() {
    }

    public OneBean(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "OneBean [name=" + name + "]";
    }

}
public class OneListEditor extends Composite implements
        IsEditor<ListEditor<OneBean, OneEditor>> {

    interface OneListUiBinder extends UiBinder<Widget, OneListEditor> {}
    OneListUiBinder uiBinder = GWT.create(OneListUiBinder.class);

    @UiField
    VerticalPanel panel;

    public OneListEditor() {
        initWidget(uiBinder.createAndBindUi(this));
    }

    @Override
    public ListEditor<OneBean, OneEditor> asEditor() {
        return listEditor;
    }

    private ListEditor<OneBean, OneEditor> listEditor = ListEditor
            .of(new EditorSource<OneEditor>() {
                @Override
                public OneEditor create(int index) {
                    OneEditor widget = new OneEditor();
                    panel.insert(widget, index);
                    return widget;
                }
            });

}
public class OneEditor extends Composite implements Editor<OneBean> {

    interface OneUiBinder extends UiBinder<Widget, OneEditor> {}
    OneUiBinder uiBinder = GWT.create(OneUiBinder.class);

    @UiField
    TextBox name;

    public OneEditor() {
        initWidget(uiBinder.createAndBindUi(this));
    }

}
public class OneListEditorApp implements EntryPoint {

    @Override
    public void onModuleLoad() {
        List<OneBean> beans = new ArrayList<OneBean>();
        beans.add(new OneBean("1st bean"));
        beans.add(new OneBean("2nd bean"));

        OneListEditor oneListEditor = new OneListEditor();
        oneListEditor.asEditor().setValue(beans); // exception thrown here!

        RootPanel.get().add(oneListEditor);
    }

}
java.lang.NullPointerException: null
    at com.google.gwt.editor.client.adapters.ListEditorWrapper.attach(ListEditorWrapper.java:95)
    at com.google.gwt.editor.client.adapters.ListEditor.setValue(ListEditor.java:164)
    at OneListEditorApp.onModuleLoad ....
  void attach() {
    editors.addAll(editorSource.create(workingCopy.size(), 0));
    for (int i = 0, j = workingCopy.size(); i < j; i++) {
      chain.attach(workingCopy.get(i), editors.get(i)); // ListEditorWrapper NPE here!
    }
  }

@EDIT

According to the answer from @Thomas Broyer, NPE is gone after EditDriver being wired to OneListEditor below,

interface OneEditorDriver extends
        SimpleBeanEditorDriver<OneBean, OneEditor> {}

OneEditorDriver driver = GWT.create(OneEditorDriver.class);

@Override
public ListEditor<OneBean, OneEditor> asEditor() {
    listEditor.setEditorChain(new EditorChain<OneBean, OneEditor>() {
        @Override
        public OneBean getValue(OneEditor subEditor) {
            return null;
        }
        @Override
        public void detach(OneEditor subEditor) {
        }
        @Override
        public void attach(OneBean object, OneEditor subEditor) {
            driver.initialize(subEditor);
            driver.edit(object);
        }
    });
    return listEditor;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:53:39+00:00Added an answer on June 15, 2026 at 9:53 pm

    You’re not using an EditorDriver, so the ListEditor is not initialized with an EditorChain, so chain is null, hence the NPE. Case made.

    ⇒ use an EditorDriver (or do not use a ListEditor)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When using GWT 2.0.x and SmartGWT 2.2 Code as simple as: public class SmartGwtTest
Please help me look into my simple test case: import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.RootPanel; import
I am using GWT to write a simple app. Ive divided the view into
I am using a simple FormPanel in GWT (com.google.gwt.user.client.ui.FormPanel). Once setting the action for
I built a simple Web Application using GWT and deployed it to Google App
I am newly using GWT. I am using a simple code to create popup
I try to develop a simple webapp using GWT + hibernate4 + Apache Tomcat.
I have implemented pretty simple application, using gwt and gwt event service 1.1.1, it
I am developing a simple app using GWT, Hibernate, RPC in eclipse. I am
I am trying to upload simple web app created using GWT eclipse plugin to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.