Select control array push


Ryan Sytsma

I have a series of HTTP controls that get json data from API and then the results are put into Select controls. The 1st Select control works fine but the 2nd one throws this error:

Line 386 is in this code block of app.js



Ryan Sytsma

Here is another example of code using a ArrayPush to a Select will fail.



DecSoft

Hello Ryan,

Maybe it's a typo? That is, maybe you are using an invalid identifier: "selectContract", maybe is "SelectContract", remember that Javascript is case sensitive. If I place in an app view a Select control like "Select1", there is no problem to push a new item into their Items property:

However, if by mistake a write "select1" instead, the below code produces exactly the same error that you get.



Ryan Sytsma
Hi David

I found the issue. Before I started my loop to get the array items to push into selectContract, I was calling:

To clear out any items. It should have been:



DecSoft

Hello Ryan,

Glad to know that you got it. Remember that you can use the "ArrayClear" action to clear an Array variable.



Ryan Sytsma
Thank you David

DecSoft

You're welcome! ;-)


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.