Column column = componentExt.getColumn();
container.getRelationManager().init81Or82Or83ComponentAction(componentExt);
if (action.equals("Edit")) {
//if correspendence, init the default value
if(object.getClsId()==520){
RelationManager relationManager = container.getRelationManager();
Vector parameters = relationManager.getParameters_Defvalue(componentExt);
if (parameters != null) {
String sql = relationManager.getSQL_Defvalue(componentExt, parameters);
DAO dao = DAO.getInstance();
dao.query(sql);
for (int i = 0; i < parameters.size(); i++) {
String parameter = (String)parameters.get(i);
StringTokenizer st = new StringTokenizer(parameter, ".");
String tableName = (String)st.nextElement();
String columnName = (String)st.nextElement();
ComponentExt tempComponentExt = relationManager.findComponentExt(tableName, columnName);
JComponent tempComponent = tempComponentExt.getComponent();
dao.setObject(i+1, ComponentManager.getValue(tempComponent));
}
ResultSet rs = dao.executeQuery();
try {
if (rs.next()) {
ResultSetMetaData rsmd = rs.getMetaData();
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
ComponentExt tempComponentExt = relationManager.findComponentExt(column.getTableName(), rsmd.getColumnName(i));
boolean isThisObjectColumn = (tempComponentExt != null);
if (isThisObjectColumn) {
if (rs.getObject(i) != null) {
ComponentManager.setValue(rs.getObject(i), tempComponentExt.getComponent());
}
}
}
}
rs.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
ComponentManager.setValue(getValue(componentExt.getColumn(), selectedRow), componentExt.getComponent());
} else if (action.equals("Add")) {
RelationManager relationManager = container.getRelationManager();
Vector parameters = relationManager.getParameters_Defvalue(componentExt);
if (parameters != null) {
String sql = relationManager.getSQL_Defvalue(componentExt, parameters);
DAO dao = DAO.getInstance();
dao.query(sql);
for (int i = 0; i < parameters.size(); i++) {
String parameter = (String)parameters.get(i);
StringTokenizer st = new StringTokenizer(parameter, ".");
String tableName = (String)st.nextElement();
String columnName = (String)st.nextElement();
ComponentExt tempComponentExt = relationManager.findComponentExt(tableName, columnName);
JComponent tempComponent = tempComponentExt.getComponent();
dao.setObject(i+1, ComponentManager.getValue(tempComponent));
}
ResultSet rs = dao.executeQuery();
try {
if (rs.next()) {
ResultSetMetaData rsmd = rs.getMetaData();
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
ComponentExt tempComponentExt = relationManager.findComponentExt(column.getTableName(), rsmd.getColumnName(i));
boolean isThisObjectColumn = (tempComponentExt != null);
if (isThisObjectColumn) {
if (rs.getObject(i) != null) {
ComponentManager.setValue(rs.getObject(i), tempComponentExt.getComponent());
}