Setting value list from array - inconsistent results

I have a privileges table where different user types have a single field with check boxes with up to 7 values.

I want to create an array from the selected values using:

var myArray = my_check_field.split(‘\n’);

Then I want to use the array in a value list:

application.setValueListItems (‘cust_list’, myArray);

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’.

Is this a bug or am I going wrong?

OS X 10.3, java 1.4.1 and 2.0rc3

Do you also have a, sometimes, empty list? Because that’s what I have sometimes (and not reproducable)… Same platform…

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!

can you give me an example (solution) of what works and what not?

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.

Am still trying…

And reproducing the issue is exactly my issue too…

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.

do you guys already have some reproducable test solution?

Johan, I will put some effort into that tomorrow…

I have built a test solution with one valuelist.

I didn’t seen ANY issue unfortunately.

I also checked my existing solution over and over for things I do wrong etc.

Do only things I can say are:

  • I do not see any pattern. I haven’t seen the issue appearing today…
  • The valuelist are created, I check that every startup (also when it goes wrong)…
  • It looks like the valuelist is emptied while the solution is already open… Can’t think of anything else…
  • BTW these finding count for both developer and client…

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.