Hi,
For this situation I am using an older version of Smartclient: 8.3 (from may 2012).
If a DataSource JSON response contains some fields with null value, when it is handled (DataSource._handleJSONReply) these values are transformed into undefined.
The problem is in DataSource.validateJSONRecord, where field value is compared to undefined using != operator, this comparison evaluates to false in case of null, causing this transformation.
Is this an intentional behavior, if so, why? if not, is it something which can be fixed (in the development build I am using also for the calendar changes)?
I created this diff (against the latest build) to solve it:
gr. Martin
For this situation I am using an older version of Smartclient: 8.3 (from may 2012).
If a DataSource JSON response contains some fields with null value, when it is handled (DataSource._handleJSONReply) these values are transformed into undefined.
The problem is in DataSource.validateJSONRecord, where field value is compared to undefined using != operator, this comparison evaluates to false in case of null, causing this transformation.
Is this an intentional behavior, if so, why? if not, is it something which can be fixed (in the development build I am using also for the calendar changes)?
I created this diff (against the latest build) to solve it:
Code:
diff -r 37f701078f51 web/org.openbravo.userinterface.smartclient/isomorphic/client/application/DataSource.js --- a/web/org.openbravo.userinterface.smartclient/isomorphic/client/application/DataSource.js Mon Sep 23 13:00:24 2013 +0200 +++ b/web/org.openbravo.userinterface.smartclient/isomorphic/client/application/DataSource.js Thu Sep 26 14:10:02 2013 +0200 @@ -10531,7 +10531,7 @@ } var undef; - if (fieldValue != undef) { + if (fieldValue !== undef) { // validation fieldValue, if it is complex type var fieldDS = isc.DS.get(field.type); if (fieldDS && !(fieldDS.skipJSONValidation)) {
Comment