Announcement

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

    DataSource not updating data

    All

    I have a listGrid defined as follows

    Code:
    DataSource source = new DataSource();
    ListGrid grid = new ListGrid();
    grid.setDataSource(this.executionsDataSource);
    grid.setAutoFetchData(true);
    When I insert a record into the DataSource

    Code:
    dataSource.addData(record, new DSCallback() {
    				
    				@Override
    				public void execute(DSResponse response, Object rawData, DSRequest request) {
    						logger.log(Level.FINE, "Record with execution id ["+response.getStatus()+"]");
    				}
    			});
    If I then receive a new request very quickly and I try and search the grid to see if we already have a similar object


    Code:
    Record record = (Record) grid.getRecordList().find("field1", value);
    The grid does not return anything. But the callBack does get called after a while.

    #2
    The way we got around this was doing the following before a search on the listGrid

    Code:
    private final runAgain(Data object, true) {
    
    Record record = (Record)this.display.getListGrid().getRecordList().find(Record.GRID_EXECID, execOrderId);
    
    if(firstTime) {
    				Timer t = new Timer() {
    					public void run() {
    						runAgain(data, false);
    					}
    				};
    				// Schedule the timer to run once in 5 second.
    				t.schedule(5000);
    				return;
    				
    			}
    
    
    }

    Comment

    Working...
    X