Page 1 of 1

Trouble Setting Default for Drop Down

Posted: Tue Feb 18, 2020 11:26 am
by mkasenchak
I am having trouble setting a default value for my database driven drop down.

i've tried

Code: Select all

applyProperty("SearchD1DDown", "choice values field","BPPRIT");
applyProperty("SearchD1DDown", "choice options field","ITEM NUMBER");
and i've also tried

Code: Select all

pui.set("SearchD1DDown","BPPRIT");
and i've also tried

Code: Select all

applyProperty("SearchD1DDown", "value","BPPRIT");
none of these seem to work in setting the default when the screen loads

Re: Trouble Setting Default for Drop Down

Posted: Thu Feb 20, 2020 11:55 am
by Scott Klement
So, you have something else set, but you are trying to change it in your onload event?

The database process to load the widget has already begun running when your onload has fired, so changing the properties there won't affect it unless you also re-render (aka "re-run" the database process) after you've changed the properties.

You'd do this with:

Code: Select all

applyProperty("SearchD1DDown", "widget type","select box");
Setting the widget type (even if it is to the same type of widget) will cause it to re-render.