if (window != null) {
// If it was search form and "close" button was not clicked, then
if (window.getCustomFormType() == CustomFormType.Search
&& !window.isCanceled()) {
// Reload grid with new search parameters
SelectParams params = new SelectParams();
params.setSearchRow(window.getDataRow());
this.loadData(params);
} else {
// Else simply reload grid (if data was changed)
if (window.dataChanged())
this.loadData();