Duplicates displayed in COMBOBOX

Hi, I am currently using a Field with displayType of “COMBOBOX”. The valuelist is coming from a global method which returns a dataset.

When I open the form, which includes the COMBOBOX, at runtime in the developer or application server, the list contain duplicate items.

If I have:
item 1
item 2

it will display
item 1
item 2
item 1
item 2

But when I try to put a break point inside the global method and run the codes line by line, it displays the valuelist in the combobox without duplicates.

Has anybody encountered this problem? I am using Servoy 6.0.6.

What if instead of putting a breakpoint you just print out (with application.output()) the valuelist’s items? Maybe also print a message when the global method starts and when it ends execution. Does everything look ok then? If yes, is this easily reproducible?

Hi Andrei,

Thanks for the reply.

I added an application.output and I did not find any problem with the results The dataset items got printed correctly. The size of the dataset was also correct.

However when I checked the “combobox display”, it has every item in the list doubled. When I deselect and select the combobox again, it gets displayed correctly.

The issue is intermittent.

This is very confusing for the users.

Erik

Maybe the cause is in the global method ?

In the sample code for a valuelist based on a global method there are 3 ways the valuelist can be set.
One of those 3 will add a new value to the existing valuelist, maybe that is the cause ?

Regards,

Thanks Hans for the reply.

The globals method returns the correct dataset. There should be no problem with the globals method.

I found a specific way to replicate the problem. The duplication happens when the dataprovider does not match any of the items in the dataset of the valuelist.

Oke,

Thats is exacltly what I ment.
I think this is default behaviour in this case.
I think this is also mentioned in the comment of the sample method that you can create for a global method valuelist.
Maybe one of the Servoyans can comment on this.

Regards,

there are not really 3 ways it can be set.
There are 3 ways a global method can be called. And you should not just always return the full list!
Please look carefully at the example that we do give
there are 3 modes:

1> the full list
2> the filtered list based on a the display value given (this is not used for a combo box)
3> 1 display value based on the given real value (because the full list didn’t have the real value)