3
    i want to delete the row from the grid...and changes should reflect
    into my database..Please provide me some idea to do that...

The above code was later updated by me and i already added the data source in which i am initializing the fields. Updated code as follws 
listgrid = new SigmaListGrid();
listgrid.setDataSource(screenDS);
return listgrid;                                                                                                       public 
SigmaListGrid() {
        setShowFilterEditor(true);
        setHeight100();
        setWidth100();
        setShowRecordComponents(true);
        setShowRecordComponentsByCell(true);
        setCanRemoveRecords(true);
        setShowAllRecords(true);
        setCanResizeFields(true);
        setCanEdit(true);
        setAutoSaveEdits(false);
    }                                                                       
}

===

public class ScreenDataSource extends TPDDataSource {

/**
 * @param id
 */
public ScreenDataSource(String id) {
    super(id);
    initializeFields();
}

private void initializeFields() {

    DataSourceField pkField = new DataSourceIntegerField(...
    DataSourceField screenName = new DataSourceTextField(.....);
    screenName.setCanEdit(true);

    setFields(pkField, screenName;
}

@Override
public void clearData() {
    // TODO Auto-generated method stub

}
/**
 * This method will populate the data
 * @param records
 */
public void setData(List<ScreenGridRecord> records) {
    clearData();
    for (ScreenGridRecord screenGridRecord : records) {
        addData(screenGridRecord);
    }
}


@Override
public void setData() {

}   

}

Thanks @kimi ,i am adding a new row in list 
grid by listgrid.startEditingNew(); in newly added row i am inserting new data.Now i want to save the data @ server side .I also used listgrid.saveAllEdits(); but it is not working .            
Dhruva
  • 185
  • 1
  • 3
  • 15

1 Answers1

1

First of all, your ListGrid does not have a DataSource in the provided code. A ListGrid needs a DataSource to be data bound.

From a user interface point-of-view that code should be functional, given that your ListGrid's datasource implements the needed operations (add, fetch, update, remove). I'm guessing you do not have the DataSource set up properly.

Kimi
  • 6,239
  • 5
  • 32
  • 49
  • the above code was later updated by me and i already added the data source in which i am initializing the fields. Updated code as follws listgrid = new SigmaListGrid(); listgrid.setDataSource(screenDS); return listgrid; – Dhruva Aug 13 '11 at 07:31
  • If you're using traditional GWT services, it's best to take a look at GWT-RPC Datasource (http://forums.smartclient.com/showthread.php?t=4814). Just do the database operation on your server side. E.g. in your addMyObject(Object obj) method of your service. – levivanzele Oct 31 '11 at 15:28