Results 1 to 2 of 2

Thread: Send BeanModel.getBean() through RPC generates NullPointer

  1. #1
    Ext User
    Join Date
    Jun 2009
    Posts
    9
    Vote Rating
    0
      0  

    Default Send BeanModel.getBean() through RPC generates NullPointer

    GWT 1.6.4
    GXT 2.0m2

    When a i create a BeanModel on the cliente and try to send it to the server i get a NullPointerException. I've debugged the code, the bean works fine, the problem occurs when call the service.

    Create the BeanModel. I use a formBinding to bind the data and it works fine.
    Code:
    BeanModelFactory factory = BeanModelLookup.get().getFactory(bean.getClass());
    data = factory.createModel(bean);
    Dispatch the event using mvc
    Code:
    AppEvent event = new AppEvent(XXXEvents.Save);
    event.setData(SERVICE, service);
    event.setData(DATA, data);
    
    Dispatcher.get().dispatch(event);
    Up to this point my bean works fine and has some values. But when i execute the service the server throws a NullPointerException.
    Code:
    BeanModel data = event.getData(DATA);
    RemovalServiceAsync service = event.getData(SERVICE);
    
    service.remove((BeanModelTag) data.getBean(), new AsyncCallback<Boolean>() {...}

  2. #2
    Ext User
    Join Date
    Jun 2009
    Posts
    9
    Vote Rating
    0
      0  

    Default

    The code is working. When fill my Grid store, get the BeanModel from that store and execute the code above it works fine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •