Parameter table creation restrictions (READONLY, WRITEONCE) better
distinguish between create/insert, and update.
This commit is contained in:
parent
35ebbe6d4f
commit
5ef8615a54
@ -83,7 +83,7 @@ public abstract class AbstractModule implements Module, Serializable {
|
|||||||
application.getMainWindow().removeWindow(childWindow);
|
application.getMainWindow().removeWindow(childWindow);
|
||||||
try {
|
try {
|
||||||
Map<String, XmlrpcProperty> map = new HashMap<String, XmlrpcProperty>();
|
Map<String, XmlrpcProperty> map = new HashMap<String, XmlrpcProperty>();
|
||||||
genericForm.transferToHash(map, form);
|
genericForm.transferToHash(map, form,false);
|
||||||
((InsertAble) thisModule).insertRow(map);
|
((InsertAble) thisModule).insertRow(map);
|
||||||
componentFactory.loadData();
|
componentFactory.loadData();
|
||||||
} catch (HsarwebException e) {
|
} catch (HsarwebException e) {
|
||||||
|
@ -141,7 +141,7 @@ public class GenericForm {
|
|||||||
return idKey;
|
return idKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void transferToHash(Map<String, XmlrpcProperty> map, Form form) throws HsarwebException {
|
public void transferToHash(Map<String, XmlrpcProperty> map, Form form, boolean update) throws HsarwebException {
|
||||||
Iterator<Component> iterator = form.getLayout().getComponentIterator();
|
Iterator<Component> iterator = form.getLayout().getComponentIterator();
|
||||||
Object formData = form.getData();
|
Object formData = form.getData();
|
||||||
if (formData != null && formData instanceof Long) {
|
if (formData != null && formData instanceof Long) {
|
||||||
@ -154,7 +154,7 @@ public class GenericForm {
|
|||||||
String propName = (String) data;
|
String propName = (String) data;
|
||||||
PropertyConfig property = module.getModuleConfig().getProperty(propName);
|
PropertyConfig property = module.getModuleConfig().getProperty(propName);
|
||||||
PropertyFieldFactory fieldFactory = property.getPropFieldFactory();
|
PropertyFieldFactory fieldFactory = property.getPropFieldFactory();
|
||||||
if (!fieldFactory.isReadOnly() && !fieldFactory.isWriteOnce()) {
|
if (!fieldFactory.isReadOnly() && (!update || !fieldFactory.isWriteOnce())) {
|
||||||
map.put(propName, property.getPropFieldFactory().getValue(property, component));
|
map.put(propName, property.getPropFieldFactory().getValue(property, component));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -231,7 +231,7 @@ public class TableComponentFactory implements ComponentFactory, Serializable {
|
|||||||
application.getMainWindow().removeWindow(childWindow);
|
application.getMainWindow().removeWindow(childWindow);
|
||||||
try {
|
try {
|
||||||
Map<String, XmlrpcProperty> map = new HashMap<String, XmlrpcProperty>();
|
Map<String, XmlrpcProperty> map = new HashMap<String, XmlrpcProperty>();
|
||||||
genericForm.transferToHash(map, form);
|
genericForm.transferToHash(map, form,true);
|
||||||
((UpdateAble) module).updateRow(map);
|
((UpdateAble) module).updateRow(map);
|
||||||
loadData();
|
loadData();
|
||||||
} catch (HsarwebException e) {
|
} catch (HsarwebException e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user