diff --git a/entity/AttributeRelation_entity/entityfields/attributerelation_value/displayValueProcess.js b/entity/AttributeRelation_entity/entityfields/attributerelation_value/displayValueProcess.js index d335cd62e77addfc931bed30ac991706c5750333..a740c792ce459f70fa42d619de7ef61148d5e405 100644 --- a/entity/AttributeRelation_entity/entityfields/attributerelation_value/displayValueProcess.js +++ b/entity/AttributeRelation_entity/entityfields/attributerelation_value/displayValueProcess.js @@ -2,10 +2,10 @@ import("system.db"); import("system.result"); import("system.vars"); import("Attribute_lib"); -import("Sql_lib"); -var attributeId = vars.get("$field.AB_ATTRIBUTE_ID"); -var attrType = AttributeHandler.begin(attributeId).getAttributeType(); +var attrType = AttributeHandler.begin(vars.get("$field.AB_ATTRIBUTE_ID")).getAttributeType(); if (attrType == $AttributeTypes.COMBO) - result.string(AttributeUtil.getSimpleAttributeName(vars.get("$field.ID_VALUE"))); \ No newline at end of file + result.string(AttributeUtil.getSimpleAttributeName(vars.get("$field.ID_VALUE"))); +else + result.string(vars.get("$field.ATTRIBUTERELATION_VALUE")); diff --git a/entity/AttributeRelation_entity/entityfields/attributerelation_value/possibleItemsProcess.js b/entity/AttributeRelation_entity/entityfields/attributerelation_value/possibleItemsProcess.js index 6aff0255e3f9b244d81ed6168501b93dde182fb4..41294703389058f527824cabc768946894055718 100644 --- a/entity/AttributeRelation_entity/entityfields/attributerelation_value/possibleItemsProcess.js +++ b/entity/AttributeRelation_entity/entityfields/attributerelation_value/possibleItemsProcess.js @@ -14,6 +14,5 @@ if (attrType == $AttributeTypes.COMBO) .andPrepare("AB_ATTRIBUTE.ATTRIBUTE_TYPE", $AttributeTypes.COMBOVALUE) .buildSql("select AB_ATTRIBUTEID, ATTRIBUTE_NAME from AB_ATTRIBUTE"); var valueList = db.table(valueSql); - result.object(valueList); -} \ No newline at end of file +} diff --git a/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js b/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js index 33a878bf683706d59c2a7658f97f66223ebc6fbf..737c6e3a51228fc8f0e69135a0c87bd2e46cdbfe 100644 --- a/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js +++ b/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js @@ -8,19 +8,19 @@ if (attrType != null) //load the value from the correct field for the type { switch (attrType) { - case $AttributeTypes.TEXT: + case $AttributeTypes.TEXT.toString(): result.string(vars.get("$field.CHAR_VALUE")); break; - case $AttributeTypes.DATE: + case $AttributeTypes.DATE.toString(): result.string(vars.get("$field.DATE_VALUE")); break; - case $AttributeTypes.NUMBER: + case $AttributeTypes.NUMBER.toString(): result.string(vars.get("$field.NUMBER_VALUE")); break; - case $AttributeTypes.BOOLEAN: + case $AttributeTypes.BOOLEAN.toString(): result.string(vars.get("$field.BOOL_VALUE")); break; - case $AttributeTypes.COMBO: + case $AttributeTypes.COMBO.toString(): result.string(vars.get("$field.ID_VALUE")); break; } diff --git a/process/Attribute_lib/process.js b/process/Attribute_lib/process.js index 7039cc1af029b4c09ac6e18dcf0dcf2cea137993..b12e5dc963037701d9f7bb0cf063ebed33f0e602 100644 --- a/process/Attribute_lib/process.js +++ b/process/Attribute_lib/process.js @@ -204,43 +204,50 @@ AttributeHandler.prototype.setAttributeValue = function (pValue) function $AttributeTypes () {} $AttributeTypes.TEXT = { - toString : function () {return "TEXT"}, + toString : function () {return this.keyword}, + keyword : "TEXT", contentType : "TEXT", databaseField : "CHAR_VALUE", entityField : "CHAR_VALUE" }; $AttributeTypes.DATE = { - toString : function () {return "DATE"}, + toString : function () {return this.keyword}, + keyword : "DATE", contentType : "DATE", databaseField : "DATE_VALUE", entityField : "DATE_VALUE" }; $AttributeTypes.NUMBER = { - toString : function () {return "NUMBER"}, + toString : function () {return this.keyword}, + keyword : "NUMBER", contentType : "NUMBER", databaseField : "NUMBER_VALUE", entityField : "NUMBER_VALUE" }; $AttributeTypes.BOOLEAN = { - toString : function () {return "BOOLEAN"}, + toString : function () {return this.keyword}, + keyword : "BOOLEAN", contentType : "BOOLEAN", databaseField : "BOOL_VALUE", entityField : "BOOL_VALUE" }; $AttributeTypes.COMBO = { - toString : function () {return "COMBO"}, + toString : function () {return this.keyword}, + keyword : "COMBO", contentType : "TEXT", databaseField : "ID_VALUE", entityField : "ID_VALUE" }; $AttributeTypes.COMBOVALUE = { - toString : function () {return "COMBOVALUE"}, + toString : function () {return this.keyword}, + keyword : "COMBOVALUE", contentType : null, databaseField : null, entityField : null }; $AttributeTypes.GROUP = { - toString : function () {return "GROUP"}, + toString : function () {return this.keyword}, + keyword : "GROUP", contentType : null, databaseField : null, entityField : null