Dynamic Context Menu returns choice (text) not value
Posted: Thu Aug 09, 2018 3:11 pm
I'm using the menu widget for a context menu on a grid (subfile) that changes the choices programatically, depending on the screen mode (browse, add change, etc.),which is indicated in an output field in the heading ("D_1_2"). Everything works correctly except the menu is returning the choice (selected text) and not the choice value (option number). I'm using this to place the option number in the subfile option field and press Enter. Can anyone see what I'm doing wrong?
Grid Onrowclick:
Menu Onoptionclick:
Grid Onrowclick:
Code: Select all
// Send row clicked to context menu.
applyProperty("propOpts","user defined data", row);
// Check mode using screen heading and set menu choices.
if (get("D_1_2") === "Browse") {
applyProperty("propOpts", "choices", "Select Coverage Part/Location");
applyProperty("propOpts", "choice values", "1");
} else {
applyProperty("propOpts", "choices", "Select Coverage Part/Location, Copy Location, Insert Bid, Change Loc/Bld Nbr");
applyProperty("propOpts", "choice values", "1, 3, 6, 7");
}
// Refresh context menu poperties.
applyProperty("propOpts", "field type", "menu");
Code: Select all
var rowNumber = this.pui.properties["user defined data"] + 8;
changeElementValue("I_" + rowNumber + "_2", value);
pressKey("Enter");