Define a UI Action with a parameter ItemName (parameters[0]) and call shmi.numpad(p).
(function() {
var actions = shmi.pkg("visuals.session.userActions"); //get reference to userActions object
actions["_Open-NumPad"] = function(parameters) {
const im = shmi.visuals.session.ItemManager;
oVal = im.readValue(params[0]);
if (oVal===null) {
alert(params[0] + " item not defined");
} else {
let p = {
unit: "", // unit for display
label: "", // label for display
value: oVal, // initial value for edit
callback: function(value) {
im.writeValue(p.item, value);
},
min: 0, // min. value
max: 100, // max. value
type: 2, // 2=INT 3=REAL
precision: 2, // number of digits
item: parameters[0] // item name e.g. "SInt"
};
shmi.numpad(p);
}
};
}());
... View more