scorecardModel.setReasonCodeField(rcField);
}
scorecardModel.getCharacteristics().clear();
for (DirtyableFlexTable flexTable : characteristicsTables) {
Characteristic characteristic = new Characteristic();
characteristic.setName(((TextBox) flexTable.getWidget(0, 1)).getValue());
enumDropDown = (EnumDropDown) flexTable.getWidget(2, 0);
String simpleFactName = enumDropDown.getValue(enumDropDown.getSelectedIndex());
if (sce.getModelFields().get(simpleFactName) != null){
for (ModelField mf : sce.getModelFields().get(simpleFactName)) {
////System.out.println(">>>> "+mf.getType()+" "+mf.getClassName()+" "+mf.getName());
if (mf.getType().equals(simpleFactName)){
characteristic.setFact(mf.getClassName());
break;
}
}
}
enumDropDown = (EnumDropDown) flexTable.getWidget(2, 1);
if (enumDropDown.getSelectedIndex() > -1) {
String fieldName = enumDropDown.getValue(enumDropDown.getSelectedIndex());
fieldName = fieldName.substring(0, fieldName.indexOf(":")).trim();
characteristic.setField(fieldName);
} else {
characteristic.setField("");
}
characteristic.setReasonCode(((TextBox) flexTable.getWidget(2, 3)).getValue());
String baselineScore = ((TextBox) flexTable.getWidget(2, 2)).getValue();
try {
characteristic.setBaselineScore(Double.parseDouble(baselineScore));
} catch (Exception e) {
characteristic.setBaselineScore(0.0d);
}
scorecardModel.getCharacteristics().add(characteristic);
characteristic.setDataType(getDataTypeForField(simpleFactName, characteristic.getField()));
System.out.println(">>>SetDataType -->"+simpleFactName+"<-->"+characteristic.getField()+"<-->"+characteristic.getDataType()+"<--");
characteristic.getAttributes().clear();
characteristic.getAttributes().addAll(characteristicsAttrMap.get(flexTable).getList());
}
saveCommand.save();
} catch (Throwable t ) {
t.printStackTrace();
}