How to pass the menu response to the program

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
TomM
New User
Posts: 6
Joined: Mon Nov 07, 2016 12:09 pm
First Name: Tom
Last Name: M
Company Name: Hal Leonard
Contact:

How to pass the menu response to the program

Post by TomM »

I am working with context menus. Currently doing the following in the onoptionsclick property in the context menu:

Code: Select all

var rowClicked = this.pui.properties["user defined data"];

switch(value) {
  case 'V':
    var imageObj = getObj("BtnView." + rowClicked);
    break;
  
  case 'C':
    var imageObj = getObj("BtnChange." + rowClicked);
    break;
  
  case 'D':
    var imageObj = getObj("BtnDelete." + rowClicked);
    break;
  
  case 'E':
    var imageObj = getObj("BtnExpand." + rowClicked);
    break;
}
pui.click(imageObj);
So basically clicking the button for the option I want. Then in the RPG, I do:

Code: Select all

When Scn_BtnDelete = *On

etc...

The problem with this approach is that I need a button for each menu option.
I want to just pass the Choice value to the RPG. I would assume this would get passed in the "Menu Response" field, but it is always blank.

Instead of doing the switch statement in JS, I want to do it in RPG.

Basically I want to be able to do this in the RPG:

Code: Select all

When Scn_CtxRsponse = 'V';

When Scn_CtxRsponse = 'D';

When Scn_CtxRsponse = 'E';

etc..etc...
Is this possible?

Thanks
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: How to pass the menu response to the program

Post by Scott Klement »

Either (a) eliminate the onoptionclick (if it us unneeded) and simply always the Menu Response property....
... or use pui.set() to set a hidden textbox to the value...
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests