Announcement

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

    Forcing datasource to refresh grid row.

    Hi,
    I am using gwt comet to push data into my grid data source. I have a collection of all records added to the data source and when some data arrives i update the appropriate record from the collection with record.setAttribute("fieldtoupdate", pushedValue). But this does not update the grid. I need to call :
    grid.refreshRow(grid.getRecordIndex(record)) in order to update the ui grid. All this is happening in the data source and i have :
    Code:
    public class UpdatableListGridRecord extends ListGridRecord implements UpdateListener {
    	
    	private ListGrid grid;
    	
    	public UpdatableListGridRecord(ListGrid grid) {
    		this.grid = grid;
    	}
    
    	@Override
    	public void update(double pushedValue) {
    		this.setAttribute("pushedValue", pushedValue);
    		grid.refreshRow(grid.getRecordIndex(this));
    	}
    
    }
    But in order to use this i need to have reference to the grid object in my data source, which is not correct. So any ideas how from the data source i can tell the grid to update it's record?
    Regards.

    #2
    Generally, you would use the Registration design pattern so that anyone can call a method to get notified when a successful DataSource change happens.

    Comment

    Working...
    X