How to pass the menu response to the program
Posted: Tue Mar 21, 2017 5:32 pm
I am working with context menus. Currently doing the following in the onoptionsclick property in the context menu:
So basically clicking the button for the option I want. Then in the RPG, I do:
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:
Is this possible?
Thanks
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);
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...
Thanks