Hello,
Once again I find myself thwarted by Guicomposer. This time I'm having trouble persuading the combobox widget to work bi-directionally.
I have a number of short ints in my target program into which I want to be able to allow the user to set specific values.
I thought the combo box would be the ideal tool for this. Now I can get it set up with the aid of a bit of background pre-processing javascript to convert the short int value to a suitable string. i.e to convert the numbers 1,2,3 into strings "1phase", "2phase" & "3phase" and it displays these fine so it is doing something.
Interestingly I could not get the "Switch case" function to work in my javascript pre-processing code and had to resort to using an "if else" function instead. Might this be due to the short data type on the target? I couldn't think of anything else that would stop it working and checked the syntax several times with a javascript reference example. I could find no guidance regarding javascript's sensitivity to datatypes. I used a separate text widget on my test display the numeric data was being displayed fine..
Now, try as I might I can't get the combobox to work the other way round, i.e if I want to be able to select the 1phase, 2phase or 3phase drop downs in the box that I have designed into the widget it just sits there and won't update the bound variable.
I have tried various options firstly doing nothing nothing (hoping that the default value might be 1,2,3 for the design labels) then I have tried putting some post processing javascript to convert the "1phase", "2phase" etc strings into the numbers 1,2,3 and various other guesses. But as yet, no success and I have casted around looking for an example to no avail....
So if you can point me at a good example of bidirectional usage of this widget or perhaps suggest where I'm going wrong that would be helpful.
regards
Steve