diff --git a/workflow/engine/js/controls/variablePicker.js b/workflow/engine/js/controls/variablePicker.js index ab1f29b0b..127e345ba 100644 --- a/workflow/engine/js/controls/variablePicker.js +++ b/workflow/engine/js/controls/variablePicker.js @@ -13,12 +13,16 @@ var getVariableList = function (queryText, proUid, varType){ }); oRPC.make(); + //alert(oRPC.xmlhttp.responseText); responseData = eval ("(" +oRPC.xmlhttp.responseText+ ")"); + return responseData; } -leimnud.event.add(document.getElementById('type_variables'), 'change', function(event) { - console.log('Dropdown Type of Variables'); +leimnud.event.add(document.getElementById('type_variables'), 'change', function(e) { + //console.log('Dropdown Type of Variables'); + generateListValues(); + }); leimnud.event.add(document.getElementById('prefix'), 'change', function(event) { @@ -41,15 +45,25 @@ leimnud.event.add(document.getElementById('search'), 'keypress', function(e) { e.stopPropagation(); e.preventDefault(); } - return false; + //return false; } }); var generateListValues = function(){ - var combo = document.getElementById("_Var_Form_"); + var list = getVariableList('', document.getElementById("process").value, document.getElementById('type_variables').value); + var combo = document.getElementById("_Var_Form_"); var option = document.createElement('option'); - combo.options.add(option, 0); - combo.options[0].value = "valor"; - combo.options[0].text = "Textojjjjj"; + for (m=combo.options.length-1;m>=0;m--){ + combo.options[m]=null + } + + for (var i=0; i< list.length; i++){ + console.log(list[i].sValue); + var combo = document.getElementById("_Var_Form_"); + var option = document.createElement('option'); + combo.options.add(option, 0); + combo.options[0].value = list[i].sName; + combo.options[0].text ='@@'+list[i].sName+' ('+list[i].sLabel+')'; + } }