details: https://code.openbravo.com/erp/devel/pi/rev/407f2d03251e
changeset: 21923:407f2d03251e
user: Augusto Mauch <augusto.mauch <at> openbravo.com>
date: Wed Feb 05 17:19:02 2014 +0100
summary: Fixes issue 25630: Fixes Column name and inp column name of property
fields
The inp column name of the property fields was obtained in the same way as the
other standard fields. If a tab had two fields, one being a standard field based
on a column name i.e. myColumn, and another property field called i.e.
businessPartner.myColumn, then when the combos were calculated one of them
would be ove
rwritten by the other.
diffstat:
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
| 64 +++++++--
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewFieldHandler.java
| 8 +-
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java
| 11 +-
3 files changed, 67 insertions(+), 16 deletions(-)
diffs (157 lines):
diff -r c0045023efc1 -r 407f2d03251e
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
---
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
Wed Feb 05 13:46:59 2014 +0100
+++
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
Wed Feb 05 17:19:02 2014 +0100
@@ -408,10 +408,16 @@
continue;
}
- jsonColumnValues.put(
- OBViewFieldHandler.getFieldColumnName(field, null),
- columnValues.get("inp"
- +
Sqlc.TransformaNombreColumna(field.getColumn().getDBColumnName())));
+ String inpColName = null;
+ if (field.getProperty() != null && !field.getProperty().isEmpty()) {
+ inpColName = "inp" + "_propertyField_"
+ + Sqlc.TransformaNombreColumna(field.getName()).replace(" ",
"") + "_"
+ + field.getColumn().getDBColumnName();
+ } else {
+ inpColName = "inp" +
Sqlc.TransformaNombreColumna(field.getColumn().getDBColumnName());
+ }
+ jsonColumnValues.put(OBViewFieldHandler.getFieldColumnName(field,
null),
+ columnValues.get(inpColName));
}
finalObject.put("columnValues", jsonColumnValues);
}
@@ -553,7 +559,16 @@
if (field.getColumn() == null) {
continue;
}
- columnsOfFields.put(field.getColumn().getDBColumnName(), field);
+
+ String colName = null;
+ if (field.getProperty() != null && !field.getProperty().isEmpty()) {
+ colName = "_propertyField_"
+ + Sqlc.TransformaNombreColumna(field.getName()).replace(" ", "") +
"_"
+ + field.getColumn().getDBColumnName();
+ } else {
+ colName = field.getColumn().getDBColumnName();
+ }
+ columnsOfFields.put(colName, field);
}
List<String> changedCols = new ArrayList<String>();
for (String col : allColumns) {
@@ -661,9 +676,15 @@
}
}
- columnValues
- .put("inp" +
Sqlc.TransformaNombreColumna(field.getColumn().getDBColumnName()),
- jsonobject);
+ String colName = null;
+ if (field.getProperty() != null && !field.getProperty().isEmpty()) {
+ colName = "_propertyField_"
+ + Sqlc.TransformaNombreColumna(field.getName()).replace(" ",
"") + "_"
+ + field.getColumn().getDBColumnName();
+ } else {
+ colName =
Sqlc.TransformaNombreColumna(field.getColumn().getDBColumnName());
+ }
+ columnValues.put("inp" + colName, jsonobject);
setRequestContextParameter(field, jsonobject);
String fullPropertyName = null;
@@ -697,8 +718,15 @@
UIDefinition uiDef =
UIDefinitionController.getInstance().getUIDefinition(columnId);
// We need to fire callouts if the field is a combo
// (due to how ComboReloads worked, callouts were always called)
- JSONObject value = columnValues.get("inp"
- + Sqlc.TransformaNombreColumna(field.getColumn().getDBColumnName()));
+ String inpColName = null;
+ if (field.getProperty() != null) {
+ inpColName = "inp" + "_propertyField_"
+ + Sqlc.TransformaNombreColumna(field.getName()).replace(" ", "") +
"_"
+ + field.getColumn().getDBColumnName();
+ } else {
+ inpColName = "inp" +
Sqlc.TransformaNombreColumna(field.getColumn().getDBColumnName());
+ }
+ JSONObject value = columnValues.get(inpColName);
String classicValue;
try {
classicValue = (value == null || !value.has("classicValue")) ? "" :
value
@@ -866,17 +894,20 @@
final Property prop =
KernelUtils.getInstance().getPropertyFromColumn(field.getColumn());
String fullPropertyName = null;
+ String inpColName = null;
if (field.getProperty() != null) {
fullPropertyName = field.getProperty().replace('.', '$');
+ inpColName = "inp" + "_propertyField_"
+ + Sqlc.TransformaNombreColumna(field.getName()).replace(" ", "")
+ "_"
+ + field.getColumn().getDBColumnName();
} else {
fullPropertyName = prop.getName();
+ inpColName = "inp" +
Sqlc.TransformaNombreColumna(field.getColumn().getDBColumnName());
}
if ((mode.equals("EDIT") || mode.equals("SETSESSION"))
&& !gridVisibleProperties.contains(fullPropertyName)) {
continue;
}
- String inpColName = "inp"
- +
Sqlc.TransformaNombreColumna(field.getColumn().getDBColumnName());
try {
if (jsContent.has(inpColName)) {
final Object jsonValue = jsContent.get(inpColName);
@@ -1017,7 +1048,14 @@
if (field.getColumn() == null) {
continue;
}
- String colName = field.getColumn().getDBColumnName();
+ String colName = null;
+ if (field.getProperty() != null && !field.getProperty().isEmpty()) {
+ colName = "_propertyField_"
+ + Sqlc.TransformaNombreColumna(field.getName()).replace(" ", "")
+ "_"
+ + field.getColumn().getDBColumnName();
+ } else {
+ colName = field.getColumn().getDBColumnName();
+ }
if
(!columnsWithValidation.contains(field.getColumn().getDBColumnName())
&& !sortedColumns.contains(colName) &&
!colName.equalsIgnoreCase("documentno")) {
sortedColumns.add(colName);
diff -r c0045023efc1 -r 407f2d03251e
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewFieldHandler.java
---
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewFieldHandler.java
Wed Feb 05 13:46:59 2014 +0100
+++
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewFieldHandler.java
Wed Feb 05 17:19:02 2014 +0100
@@ -1304,7 +1304,13 @@
}
public String getInpColumnName() {
- return "inp" + Sqlc.TransformaNombreColumna(property.getColumnName());
+ String inpColumnName = null;
+ if (field != null && field.getProperty() != null) {
+ inpColumnName = "inp" + this.getColumnName();
+ } else {
+ inpColumnName = "inp" +
Sqlc.TransformaNombreColumna(property.getColumnName());
+ }
+ return inpColumnName;
}
public String getReferencedKeyColumnName() {
diff -r c0045023efc1 -r 407f2d03251e
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java
---
a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java
Wed Feb 05 13:46:59 2014 +0100
+++
b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java
Wed Feb 05 17:19:02 2014 +0100
@@ -155,8 +155,15 @@
String columnValue = "";
RequestContext rq = RequestContext.get();
if (getValueFromSession) {
- columnValue = rq.getRequestParameter("inp"
- + Sqlc.TransformaNombreColumna(field.getColumn().getDBColumnName()));
+ String inpColumnName = null;
+ if (field.getProperty() != null && !field.getProperty().isEmpty()) {
+ inpColumnName = "inp" + "_propertyField_"
+ + Sqlc.TransformaNombreColumna(field.getName()).replace(" ", "") +
"_"
+ + field.getColumn().getDBColumnName();
+ } else {
+ inpColumnName = "inp" +
Sqlc.TransformaNombreColumna(field.getColumn().getDBColumnName());
+ }
+ columnValue = rq.getRequestParameter(inpColumnName);
} else {
if (field.getColumn().getDBColumnName().equalsIgnoreCase("documentno")
|| (field.getColumn().isUseAutomaticSequence() &&
field.getColumn().getDBColumnName()
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits