Populating user interface items in Javascript


John Clarke
I have a textbox, textarea and select box on my user interface. How can I populate the values using Javascript ?

DecSoft

Hello John,

If you refers to AB controls, we can use the value property in both the Text input control and the value property of the Textarea control, and, the items and the value properties in the Select control. Take a look at that help topics and post here if you have some further questions about it.



John Clarke
Hi, I read the description "Runtime. Array of strings variable. The Items control property stores the items that are shown in the control. You can set this variable at designtime using the Array editor dialog or at runtime, like any other array variable." but I find myself still puzzled regarding how to populate the items attribute of the select component with an Array using Javascript.

I know that if I had to do this in HTML I would create an option element which I would then append to the select.

DecSoft

Hello John,

Yes; certainly we no need to add "options" into the select: we must deal with the "items" property, so, for example, we can change the items in the select in this way:

Or we can add a new item to the select in this way (remember, "items" is an Array variable):


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.