PDA

View Full Version : grid update takes focus from form



Alexander Nikiforov
10 Jul 2009, 12:18 PM
Greetings.
I have a page that has a form and a grid. The grid is refreshed every 5 seconds with data from server. Every time it refreshes the focus is taken from a text field on the form. It makes it impossible to use the form, because every 5 seconds the focus is lost.

Is there is a way to set grid to never request focus?

(Java, not java script)

Your suggestion are welcome
Thank you




Timer timer = new Timer() {
public void run() {
refreshGrid();
}
};
timer.scheduleRepeating(5000);


private void refreshGrid() {

DispGWTService.App.getInstance().getMyDtos(new AsyncCallback<MyDtoList>() {
public void onFailure(Throwable caught) {
handleGridUpdateError();
}

public void onSuccess(MyDtoList result) {
BeanModelFactory factory = BeanModelLookup.get().getFactory(MyDto.class);
towStore.removeAll();
towStore.add(factory.createModel(result.getList()));
}
});

}

sven
10 Jul 2009, 12:26 PM
This was asked today. Please use the forumsearch:

http://www.extjs.com/forum/showthread.php?t=73987

Alexander Nikiforov
10 Jul 2009, 12:38 PM
Thank you.
I am not sure what I supposed to override there. An example would be lovely.


protected void insertRows(ListStore<ModelData> store, int firstRow, int lastRow, boolean isUpdate) {
super.insertRows(store, firstRow, lastRow, isUpdate);

}


And than what?
What am I supposed to set there?
Sorry I am brand new to this library

Thank you