Update select box dynamically.
Posted: Tue Jan 21, 2020 7:53 am
Hello,
We are trying to update select box records dynamically using javascript.
As you can see in DESMER definition field: we have one query with 4 parameters, the second parameter is which we want to change.
One button with this javascript code in onClick event do this:
When record format loads we can see in Developer tools a call to PUI0009103.PGM with this parameters:
When button is pushed another call to the same program with P2 updated we can see 'Loading ...' in select box, but the records received are the same
Using SQL Query first one retrieve 288 records and second one 45:
We are trying to update select box records dynamically using javascript.
As you can see in DESMER definition field: we have one query with 4 parameters, the second parameter is which we want to change.
One button with this javascript code in onClick event do this:
Code: Select all
function botonMercanciasFavoritos() {
var classes = getObj("merFav").classList;
classes.toggle("pui-solid-button-no");
classes.toggle("pui-solid-button-yes");
if (get('codFav') == 'S') {
pui.set("codFav", "N")
} else {
pui.set("codFav", "S")
}
applyProperty("DESMER", "choices parameter value 2", get('codFav'));
applyProperty("DESMER", "field type", "select box");
}
When button is pushed another call to the same program with P2 updated we can see 'Loading ...' in select box, but the records received are the same
Using SQL Query first one retrieve 288 records and second one 45: