diff --git a/workflow/engine/js/controls/variablePicker.js b/workflow/engine/js/controls/variablePicker.js index 47879c843..afdb1263a 100755 --- a/workflow/engine/js/controls/variablePicker.js +++ b/workflow/engine/js/controls/variablePicker.js @@ -84,22 +84,28 @@ leimnud.event.add(document.getElementById('search'), 'keypress', function(e) { }); function generateListValues (prefix){ - var list = getVariableList(document.getElementById('search').value, document.getElementById('process').value, document.getElementById('type_variables').value); var combo = document.getElementById("_Var_Form_"); var option = document.createElement('option'); - for (m=combo.options.length-1;m>=0;m--){ - combo.options[m]=null + + for(i=(combo.length-1); i>=0; i--) + { + aBorrar = combo.options[i]; + aBorrar.parentNode.removeChild(aBorrar); } + if(list.length>0){ - for (var i=0; i< list.length; i++){ - combo.options.add(option, 0); - combo.options[0].value = list[i].sName; - combo.options[0].text = prefix+list[i].sName+' ('+list[i].sLabel+')'; + for(i=0; i