return result;
}
private EditActionResult doEdit(int key, RunnableQuery query, Screen screen) throws SQLException
{
Field field;
Iterator<String> iterator;
ArrayList<Item> items;
EditActionResult result;
ResultSet rs;
String value;
result = new EditActionResult();
result.setNew(false);
items = new ArrayList<Item>();
query.setStatementParameters(new Object[] {new Integer(key)});
rs = query.executeQuery();
try
{
rs.next();
iterator = screen.getFields().keySet().iterator();
while (iterator.hasNext())
{
field = screen.getFields().get(iterator.next());
value = rs.getString(field.getName());
if (field.getType().equals("BOOLEAN"))
{
if (value.equals("Y"))
value="checked";
else
value = null;
}
if (field.getEditInfo().isCanUpdate())
{
items.add(new EditActionResult.Item(field.getName(), field.getType(), value));
}
else if (field.getEditInfo().isShowOnUpdate())
{
items.add(new EditActionResult.Item(field.getName(), "NOTEDITABLE", value));
}
}
result.setItems(items.toArray(new EditActionResult.Item[0]));