Announcement

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

    GWT-RPC Datasource template

    Hi,

    I am using Benjamin's GWT-RPC Datasource template (http://forums.smartclient.com/showthread.php?t=4556) and I am facing interesting problem here.

    First i have to say that I am beginner with SmartGWT so I did not make any changes !

    Im have a grid with datasource extending Ben's GwtRpcDataSource.
    When I call grid.addData(someRecord) hibernate did insert it into db and I can see the record is added (visually = new row appears) into grid.
    But when I try to immediately remove or edit this record it is not there !(Getting nullPointerException)
    After investigating I can see that even after successful insert into db and (again visual) add into grid the grid.getRecords().length is still the same as before adding !

    Has anyone ever experienced something like this ?

    Would be very appreciated if some could point me, thx

    Using SmartGWT 2.4 on Firefox 3.6.13.

    Zbynek

    #2
    My guess would be that you didn't indicate the primary key field?
    You do this in getDataSourceFields:
    Code:
    field = new DataSourceTextField("id","primary key"); 
    field.setPrimaryKey(true);
    fields.add(field);
    or you didn't set the primary key on the record you returned?
    Last edited by meindert; 15 Feb 2011, 01:52.

    Comment

    Working...
    X