@Override
public void onClick(ClickEvent event) {
errorMessages.setVisible(false);
JDBCDriver driver = null;
if(selectedTab==0)
{
form.clearValues();
SingleSelectionModel<JDBCDriver> selection =
(SingleSelectionModel<JDBCDriver>) table.getSelectionModel();
driver = selection.getSelectedObject();
if(dsClass.getValue()==null
|| dsClass.getValue().equals(""))
{
errorMessages.setText("XA Datasource Class is required!");
errorMessages.setVisible(true);
return;
}
driver.setXaDataSourceClass(dsClass.getValue());
}
else
{
FormValidation formValidation = form.validate();
if(!formValidation.hasErrors())
{
driver = form.getUpdatedEntity();
}
}
if(driver!=null) { // force selected driver
editedEntity.setDriverName(driver.getName());
editedEntity.setDriverClass(driver.getDriverClass());
editedEntity.setDataSourceClass(driver.getXaDataSourceClass());
editedEntity.setMajorVersion(driver.getMajorVersion());
editedEntity.setMinorVersion(driver.getMinorVersion());
wizard.onConfigureDriver(editedEntity);
}
else {
errorMessages.setText("A driver needs to be specified or chosen!");