col.setColumnFilterable(true);
col.setColumnSortable(false);
grid.getColumnContainer().add(col);
}
ServerGridDataLocator gridDataLocator = new ServerGridDataLocator();
ExportButton exportButton = new ExportButton();
saveButton.setExecuteAsThread(true);
grid.setValueObjectClassName("org.openswing.swing.customvo.java.CustomValueObject");
buttonsPanel.setLayout(flowLayout1);
flowLayout1.setAlignment(FlowLayout.LEFT);
grid.setEditButton(editButton);
grid.setExportButton(exportButton);
grid.setFunctionId("SYS10");
grid.setAllowColumnsProfile(false);
grid.setMaxSortedColumns(3);
grid.setReloadButton(reloadButton);
grid.setSaveButton(saveButton);
buttonsPanel.add(editButton, null);
buttonsPanel.add(saveButton, null);
buttonsPanel.add(reloadButton, null);
buttonsPanel.add(exportButton, null);
grid.setController(new GridController() {
/**
* Method invoked when the user has clicked on save button and the grid is in EDIT mode.
* @param rowNumbers row indexes related to the changed rows
* @param oldPersistentObjects old value objects, previous the changes
* @param persistentObjects value objects relatied to the changed rows
* @return an ErrorResponse value object in case of errors, VOListResponse if the operation is successfully completed
*/
public Response updateRecords(int[] rowNumbers,ArrayList oldPersistentObjects,ArrayList persistentObjects) throws Exception {
return ClientUtils.getData("updateTranslations",new Object[]{controlCompaniesCombo.getValue(),controlTopic.getValue(),oldPersistentObjects,persistentObjects});
}
});
grid.setGridDataLocator(gridDataLocator);
gridDataLocator.setServerMethodName("loadTranslations");
topPanel.add(buttonsPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
this.getContentPane().add(grid, BorderLayout.CENTER);