I am trying to create a Gui with Gui composer that can change the binding of a widget during runtime. In other words I want to dynamically bind a widget to different variables while the gui is running. Application example is having a text box or a dropdown list from which I can select different variables that I want to plot on a LineGraph. Instead of having the linegraph binded to only one target variable, I want to be able to select it on the gui. I have tried to do this by adding the following line of code in the document.addEventListener section or in a button click event:
gc.databind.registry.bind('widget.ti_widget_numberbox.value',templateObj.$.ti_widget_droplist1.selectedText);
or
gc.databind.registry.bind('widget.ti_widget_numberbox.value',templateObj.$.ti_widget_droplist1.selectedText);
It seems to work, but when I change the binding from the initial target variable to the new target variable the two global variables in my target are linked, and both take on the value of the new variable.
Is there a way to accomplish what I am trying here and what is the correct way?