cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to disable the right-click context menu in Personas?

0 Kudos

Hi,

there was a question about this in the new archive section, just wondering if this has been addressed in the latest release of Screen Personas

Dan.

Accepted Solutions (0)

Answers (2)

Answers (2)

tamas_hoznek
Product and Topic Expert
Product and Topic Expert

Yes.

Use this in the onLoad script for the screen:

session.findById("wnd[0]/mpop").hide();
0 Kudos

Hi Tamas, Thanks for the response,

This line of code works in ITS editor, but I get an script error in GUI, is there something else that I could use in this environment please?

Dan.

0 Kudos

Hi,

Just to follow up, I have ran a test

if (session.idExists ("wnd[0]/mpop") == true)

in GUI for Web, I get a True, in GUI for Windows, I get a False.

Any thoughts

tpeterke
Explorer
0 Kudos

Hi Tamas,

it looked very promising, but after two years it seems to be outdated. The problem is still the same: I have to prevent the user to do anything listed in context menus appearing on right click.

The above code delivers following error once. Then it's visible only in console.

"Error during script execution. Your script is accessing a control of type 'GuiContextMenu' with an control ID that has changed in your current system (kernel version 7.53 or greater) from the system in which the script was initially created. The script uses the ID 'wnd[0]/mpop' with the ID prefix 'mpop' but should be 'wnd[0]/mnu' (new prefix 'mnu'). Please change the script accordingly."

When I just change mpop to mnu nothing happens. In debugger i put "session.findById("wnd[0]/mnu")" into watch. Under "visible" property it says: "Control 'wnd[0]/mnu' not found". "Enabled" is the same. Maybe it's that I hid the menu bar earlier. But I also tried to reactivate it. Type is recognized correctly, it just might not be under wnd[0], I guess.

Do you know any object browser capability of the active screen?

Or maybe can you provide an up-to-date solution?

Thank you for your answer!

Kind Regards,

Peter Toth

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

In 753 kernel, there was a change in control IDs. So if the earlier method doesn't work, then this should:

session.findById("wnd[0]/usr/mnu").hide();
tpeterke
Explorer
0 Kudos

Hi Tamas,

session.findById("wnd[0]/usr/mnu") can find the object in onLoad event, but .hide() seems to be ineffective. Do you have any suggestions?

How do you find hidden control ID's? Is there any way to find them, like in the inspector of the script editor?

Kind Regards,

Peter Toth

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

I think you are testing this in Slipstream, correct?

I noticed that while session.findById("wnd[0]/usr/mnu").hide(); works fine when using the personas service, it is indeed not effective in SE. Also, while it is possible to select individual context menu items in Personas, the same is not working in SE because the context menu disappears as soon as you activate the Inspector. I created a bug report to address these problems.

tpeterke
Explorer
0 Kudos

Hi Tamas,

yepp, that's totally the case. 😞

I guess I'll have to just wait for it. And hope the users won't find out how to cheat. 😄

Thank you for all your highly appreciated answers!

Kind Regards,

Peter Toth

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

Until the SE fix is provided (which I hope will not take too long), you could disable unwanted user actions by intercepting those commands, using return true in your script for those cases. You can look into this KB article for some (indirect) hints how to do this. Not optimal, but at least it avoids some action that should be definitely prevented.

tpeterke
Explorer
0 Kudos

Hi Tamas,

thank you for the advise. This option was on the table too, but management trusts users more than I, so they decided to just wait for the straight solution.

/*We also had an issue with cl_gui_frontend_services=>execute (pdf icon in a cell of an alv being clicked should open pdf in browser (http address)). Nothing happens, and in the REST answer I find it's been rejected. I think we opened a note for it. However I solved it to work in an even nicer way.

This was just FYI.*/

Kind Regards,

Peter Toth

Thomas_Mangler
Active Participant
0 Kudos

This works for me in Screen Personas 3 SP02:

Onload-Event:

session.findById("wnd[0]/mpop").hide(); 

Regards Thomas