From 705071363456b3e3e4e5a943963288ca1fbfcb3b Mon Sep 17 00:00:00 2001 From: Roman Perin Date: Thu, 14 May 2015 14:17:56 +0300 Subject: [PATCH] There was added ability to check previous value of dropdown field after it was changed. This was done for issue #100. --- .../resources/openfaces/input/dropDownField.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openFaces/source/META-INF/resources/openfaces/input/dropDownField.js b/openFaces/source/META-INF/resources/openfaces/input/dropDownField.js index ae2435439..7590b0db4 100644 --- a/openFaces/source/META-INF/resources/openfaces/input/dropDownField.js +++ b/openFaces/source/META-INF/resources/openfaces/input/dropDownField.js @@ -425,6 +425,8 @@ O$.DropDownField = { if (dropDown._ddf_focused) O$._selectTextRange(field, field.value.length, field.value.length); + dropDown._previousLabel = dropDown._lastOnchangeItemLabel; + dropDown._previousValue = dropDown._lastOnchangeItemValue; dropDown._lastOnchangeItemLabel = dropDown.value; dropDown._lastOnchangeItemValue = dropDown._selectedItemValue; @@ -470,6 +472,14 @@ O$.DropDownField = { dropDown._setValue(text); }, + getPreviousLabel: function() { + return dropDown._previousLabel ? dropDown._previousLabel : dropDown.value; + }, + + getPreviousValue: function() { + return dropDown._previousValue ? dropDown._previousValue : dropDown._selectedItemValue; + }, + _setItemPresentationValue:function () { var selectedItem = dropDown._getSelectedItem();