Dashboard Drop Down list

Hi all

I have build a panel where i have an array, where i can insert data works fin, but how can i make that arry to be listed in a dropdown box ?

Hi Michael,

It sounds as if you might have your terms mixed up.

An array is a list of items. If a parameter is an array, it has multiple values. For example, I could have a parameter that tells me on which days I need to trigger something, and that parameter could have the multiple values, like: “Monday, Wednesday, Friday”.

A constraint is a list of choices that a parameter can have. So I could have a parameter that hods the current day of the week. It only has one value (“Tuesday”) but it has a list of choices (constraints): “Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday”. A parameter with a “choice constraint” can easily be shown as a dropdown list. That dropdown has multiple choices, but just one value.

I think that is what you are asking. If that is what you want, you need to make your parameter a “Choice Constraint”:

Put the possible values you want in the dropdown list in the Constraint Value box, and use an “Editable Dropdown List” as the Widget Hint.

If I misunderstood, and you still want your parameter to have multiple values, then let me know. Each of those values could be listed in it’s own dropdown list.

#DashBoard

Thanks for you answer, that was also how i have made it first, but now i building a new version where I have make a Table as below picture, where i want is that my first list “Syb Type” schould on other page be listed in a “drop down” ?? is that possible and if so how do i do it.

#DashBoard

Can you copy and paste your parameter definition here. It would help me show you how to achieve what you want.

#DashBoard

to you mean this infomation

#DashBoard

If you double click anywhere empty in your panel (in panelbuilder mode), it will show you the tree of the entire panel. Then click on the “source” tab at the top. Copy and paste the “” section here (or even the entire source code).

#DashBoard

Here is all

Ident Navn Title B sfd ada t1 asf dasd sub top 1 asd 6 5 ad 34 90 Syb Type Sub Navn Take ID Prev ID T1 ID Navn Title Sub Type
ID Navn Title Sub Type ogscript.debug(params.getValue('Table_Config', 0)); params.setValue(0xA, 0, params.getValue('Table_Config', 0)); Sub Type Sub Navn Take ID Prev ID /*! block id=1016 !*/ ogscript.reveal("c-opret"); /*! block id=1017 !*/ ogscript.hide("_top"); /*!! !!*/ /*!!b279a6e27ad82b64e6950d8750455a45!!*/ params.setValue('opi', 0, ''); params.setValue('Osn', 0, ''); params.setValue('ost', 0, ''); params.setValue('Oti', 0, ''); /*! block id=1018 !*/ ogscript.reveal("c-edit"); ogscript.hide("c-opret"); var id = params.getValue(0xA, 0);

var a = params.getValue(0x6, id);
var b = params.getValue(0x7, id);
var c = params.getValue(0x8, id);
var d = params.getValue(0x9, id);

params.setValue(‘ost’, 0, a);
params.setValue(‘Osn’, 0, b);
params.setValue(‘Oti’, 0, c);
params.setValue(‘opi’, 0, d);

ogscript.debug(id);



var id = params.getValue(0xA, 0);

params.getParam(0x6, id).remove();
params.getParam(0x7, id).remove();
params.getParam(0x8, id).remove();
params.getParam(0x9, id).remove();

ogscript.debug("slettede linje " + id );

var id = params.getValue('0xA', 0)

ogscript.debug(id);

var a = params.getValue(‘ost’, 0);
var b = params.getValue(‘Osn’, 0);
var c = params.getValue(‘Oti’, 0);
var d = params.getValue(‘opi’, 0);

params.setValue(0x6, id, a);
params.setValue(0x7, id, b);
params.setValue(0x8, id, c);
params.setValue(0x9, id, d);
params.setValue(‘opi’, 0, ‘’);
params.setValue(‘Osn’, 0, ‘’);
params.setValue(‘ost’, 0, ‘’);
params.setValue(‘Oti’, 0, ‘’);

var id = params.getParam("0x6",0); var idc = id.getElementCount(); ogscript.debug(idc);

var p = params.getValue(‘opi’, 0);
var sn = params.getValue(‘Osn’, 0);
var st = params.getValue(‘ost’, 0);
var ti = params.getValue(‘Oti’, 0);

params.setValue(0x6, idc, st);
params.setValue(0x7, idc, sn);
params.setValue(0x8, idc, ti);
params.setValue(0x9, idc, p);
params.setValue(‘opi’, 0, ‘’);
params.setValue(‘Osn’, 0, ‘’);
params.setValue(‘ost’, 0, ‘’);
params.setValue(‘Oti’, 0, ‘’);

#DashBoard

If should work if you add a constraint to your first parameter and change the widget, like this (I bolded the parts I changed):

sfd sfd t1 sfd ada t1

When the user clicks in the table, a dropdown will appear.

#DashBoard

thanks i see it , but not what i was look for

i have my table below that my template they user can , so on front page i would like to have a dropdown box that list all item from parameter "Sub type "

#DashBoard

What is the oid of your drop downlist param and what data type is it, string or integer?

#DashBoard

I have add dropdown aften my first share of code but it has OID test

it is string

params.setValue('kl', 0, event.getDisplay()); Ident Navn Title B sfd ada t1 asf dasd sub top 1 asd 6 5 ad 34 90 Syb Type Sub Navn Take ID Prev ID T1 ID Navn Title Sub Type sfd ada t1 ID Navn Title Sub Type /*! block id=1025 !*/ ogscript.reveal("edit"); /*! block id=1026 !*/ ogscript.hide("main"); /*!! !!*/ /*!!67463d996644a973f7b42c0edc380bc0!!*/
/*! block id=1027 !*/ ogscript.reveal("main"); /*! block id=1028 !*/ ogscript.hide("edit"); /*!! !!*/ /*!!7bc9567781888b8d20add27e6a5a229f!!*/
ogscript.debug(params.getValue('Table_Config', 0)); params.setValue(0xA, 0, params.getValue('Table_Config', 0)); Sub Type Sub Navn Take ID Prev ID /*! block id=1016 !*/ ogscript.reveal("c-opret"); /*! block id=1017 !*/ ogscript.hide("_top"); /*!! !!*/ /*!!b279a6e27ad82b64e6950d8750455a45!!*/ params.setValue('opi', 0, ''); params.setValue('Osn', 0, ''); params.setValue('ost', 0, ''); params.setValue('Oti', 0, ''); /*! block id=1018 !*/ ogscript.reveal("c-edit"); ogscript.hide("c-opret"); var id = params.getValue(0xA, 0);

var a = params.getValue(0x6, id);
var b = params.getValue(0x7, id);
var c = params.getValue(0x8, id);
var d = params.getValue(0x9, id);

params.setValue(‘ost’, 0, a);
params.setValue(‘Osn’, 0, b);
params.setValue(‘Oti’, 0, c);
params.setValue(‘opi’, 0, d);

ogscript.debug(id);



var id = params.getValue(0xA, 0);

params.getParam(0x6, id).remove();
params.getParam(0x7, id).remove();
params.getParam(0x8, id).remove();
params.getParam(0x9, id).remove();

ogscript.debug("slettede linje " + id );

var id = params.getValue('0xA', 0)

ogscript.debug(id);

var a = params.getValue(‘ost’, 0);
var b = params.getValue(‘Osn’, 0);
var c = params.getValue(‘Oti’, 0);
var d = params.getValue(‘opi’, 0);

params.setValue(0x6, id, a);
params.setValue(0x7, id, b);
params.setValue(0x8, id, c);
params.setValue(0x9, id, d);
params.setValue(‘opi’, 0, ‘’);
params.setValue(‘Osn’, 0, ‘’);
params.setValue(‘ost’, 0, ‘’);
params.setValue(‘Oti’, 0, ‘’);

var id = params.getParam("0x6",0); var idc = id.getElementCount(); ogscript.debug(idc);

var p = params.getValue(‘opi’, 0);
var sn = params.getValue(‘Osn’, 0);
var st = params.getValue(‘ost’, 0);
var ti = params.getValue(‘Oti’, 0);

params.setValue(0x6, idc, st);
params.setValue(0x7, idc, sn);
params.setValue(0x8, idc, ti);
params.setValue(0x9, idc, p);
params.setValue(‘opi’, 0, ‘’);
params.setValue(‘Osn’, 0, ‘’);
params.setValue(‘ost’, 0, ‘’);
params.setValue(‘Oti’, 0, ‘’);

#DashBoard

here is your script:

var count = params.getElementCount(0x6);
var array = ;
for (var i = 0; i < count; i++)
{
array.push(params.getValue(0x6, i));
}

var choiceConstraint = params.createStringChoiceConstraint(array);
params.replaceConstraint(“test”, choiceConstraint);

#DashBoard

Is this what you were looking for?

#DashBoard

have have now insert your code on a button, but after press the button it don´t update the choiceConstrain

and i have debug to see what i get and the data from array are fine, but not correct sent to Choise

#DashBoard

after some more test i have now got your code to work and it works as it schould. Thanks for you help

#DashBoard