The results I get are not consistent - sometimes it works fine and other times I get a mixture of correct and incorrect (i.e. NOT selected) values, often with the last value in the list truncated i.e. ‘pro’ instead of ‘providers’ or ‘admi’ instead of ‘administrators’.
IT2BE:
Do you also have a, sometimes, empty list? Because that’s what I have sometimes (and not reproducable)… Same platform…
Yes, it has happened.
I have found a fix for now:
I noticed that if I accessed the field and changed the check boxes first, then the array and the value list would always be correct. So I tried:
my_check_field = my_check_field;//reset the field to the current values
before setting the array and then the value list. Now the value list always comes back correctly!
jcompagner:
can you give me an example (solution) of what works and what not?
Actually am I now back to square 1 with inconsistent value lists again - my above solution was apparently only temporary! It is hard to send you an example because I cannot reproduce the problem consistently.
Have you noticed changes to the checkboxes? If I have a list of 7 values all checked, when this error hits the first and last checkboxes have been unchecked as well! As far as I can see there is nothing in any of the scripts that affects tha actual checkbox selections.
I think I have tracked this down. If any of the values selected in the check box field contain more than one word, then setting a value list from an array containing those values fails. If all the selected values in the checkbox field are single words only then the array created by using .split works correctly! I can reproduce this consistently and will attach a sample solution tomorrow.
In my solution there was a further complication in that the values for the checkbox field were themselves pulled from a related table and this also seems to cause problems. I will try setting the initial checkbox values also using an array and setValueListItems to see if this works better, but the ‘more than one word’ issue remains.
The valuelist suddenly again empty (or default) will be fixed in 2.0RC7
but for this
The results I get are not consistent - sometimes it works fine and other times I get a mixture of correct and incorrect (i.e. NOT selected) values, often with the last value in the list truncated i.e. ‘pro’ instead of ‘providers’ or ‘admi’ instead of ‘administrators’.
i really need a sample solution that ‘sometimes’ does this.