Page 1 of 1

Dynamic Context Menu returns choice (text) not value

Posted: Thu Aug 09, 2018 3:11 pm
by kroberson
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:

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"); 
Menu Onoptionclick:

Code: Select all

var rowNumber = this.pui.properties["user defined data"] + 8;
changeElementValue("I_" + rowNumber + "_2", value);
pressKey("Enter");

Re: Dynamic Context Menu returns choice (text) not value

Posted: Thu Aug 09, 2018 4:54 pm
by Emily
Hi Kevin,

After looking into this further, I can reproduce the problem that you are having with your menu. It seems like this may be a bug. If you send this information to our support team (support@profoundlogic.com), we can create a support ticket for you and continue to investigate this issue on our end.

Thanks!

Re: Dynamic Context Menu returns choice (text) not value

Posted: Thu Aug 09, 2018 5:19 pm
by kroberson
Will do! Thanks Emily!