I was thinking about this more, and it occurred to me that the reason you were using "user defined data" was probably because you saw an example where that property was used to pass data from the RPG program to the display... (sorry, sometimes I'm a bit slow.)
In this case, though, you're coding JavaScript that's already in the display so you don't need to do that. Don't get me wrong, it'd work fine... but imho, it's simpler to just use a JavaScript variable.
So my suggestions are:
1) Retrieve the context menu property to determine which menu (if you still need that)
2) Use a JavaScript variable for the last row clicked.
in JavaScript, global variables are created by attaching them to the 'window' object. So if you do window.XXX, you have a global variable named XXX (and you can refer to it simply as 'XXX' if there isn't any other variables with that name.)
For example, your 'onrowclick' could look like this:
Then in the menu's "onoptionclick" (run when the user selects an option from the menu) you could do something based on that row. (I don't know what your menu does, so for a really simple example, I'll just show an alert that prints what the user selected)
Code: Select all
var msg = "You selected " + text + " which is value " + value
+ " on row " + lastRowClicked;
alert(msg);
But, if for some reason you do still need to know the id of the menu for something, you can get it from the context menu id property:
Code: Select all
var menuName = getObj("PS1022_S").pui.properties["context menu id"];