Skip to content
Snippets Groups Projects
Commit 1c8244be authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

address fix

parent 7c3d080a
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,6 @@
<onValueChange>%aditoprj%/entity/Address_entity/entityfields/address/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
<element>PROCESS</element>
</onValueChangeTypes>
</entityField>
<entityField>
......@@ -55,7 +54,6 @@
<onValueChange>%aditoprj%/entity/Address_entity/entityfields/city/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
<element>PROCESS</element>
</onValueChangeTypes>
</entityField>
<entityField>
......@@ -94,7 +92,6 @@
<onValueChange>%aditoprj%/entity/Address_entity/entityfields/zip/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
<element>PROCESS</element>
</onValueChangeTypes>
<onValidation>%aditoprj%/entity/Address_entity/entityfields/zip/onValidation.js</onValidation>
</entityField>
......@@ -360,7 +357,6 @@
<onValueChange>%aditoprj%/entity/Address_entity/entityfields/addresssearch/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
<element>PROCESS</element>
</onValueChangeTypes>
</entityField>
<entityConsumer>
......
......@@ -71,7 +71,6 @@ WsValidationType.get = function(pKey)
if (pWsResult != null)
{
logging.log(JSON.stringify(pWsResult, null, "\t"))
pWsResult.forEach(function(pPlaceData) {
if (pPlaceData.address == undefined)
pPlaceData.address = {};
......@@ -272,6 +271,7 @@ WsValidationUtils.validate = function(pValue, pType, pCountry, pCity)
*/
WsValidationUtils.setAddressFields = function(pFieldToSetToValue)
{
logging.log(JSON.stringify(vars.getString("$this.value"), null, "\t"))
try
{
var data = JSON.parse(vars.getString("$this.value"));
......@@ -280,7 +280,13 @@ WsValidationUtils.setAddressFields = function(pFieldToSetToValue)
// ignore error
return
}
logging.log(JSON.stringify(typeof data, null, "\t"))
var type = typeof data;
// Only an array can be returned by the ws. V-- this check is slow -> check number and string before
if (type == "number" || type == "string" || Object.prototype.toString.call(data) !== '[object Array]')
return
_setField("$field.ZIP", data[1]);
_setField("$field.CITY", data[2]);
_setField("$field.COUNTRY", data[4]);
......@@ -296,6 +302,9 @@ WsValidationUtils.setAddressFields = function(pFieldToSetToValue)
function _setField(pField, pValue)
{
if (!pValue)
pValue = ""
neon.setFieldValue(pField, pValue);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment