cancel
Showing results for 
Search instead for 
Did you mean: 

Right-Click Event Matrix

Former Member
0 Kudos

Good Morning

Experts:

I have added several options(SAP and Custom) to the Right-Click event. It works as designed when Right-Clicking on the Matrix. However, when Right-Clicking anywhere else on the screen, the options are still displayed.

How can I restrict the options to only be displayed when Right-Clicking on a Matrix?

Thanks,

EJD

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

In right click event,u can block them by code.

if(pVal.ItemUID=="Matrix Id")

{

oForm.EnableMenu("x", true);

}

else

{

oForm.EnableMenu("x", false);

}

x-id of menu

true-if u want to enable

false-if u want to disable menu

Thanks and Regards,

Lalit

Former Member
0 Kudos

Thanks for all the responses and help...

Finally was able to get everything working. I had more than one Matrix on different Tabs of a folder that required different menu selections between them. But all is good now and for next time we'll have it.

Appreciate the help,

EJD

Answers (2)

Answers (2)

Former Member
0 Kudos

Closed too soon.

Former Member
0 Kudos

Ad:

I thought I knew where to put the validation for the Right-Click...in the ItemEvent where BeforeAction = True. For some reason it is not getting fired when Right-Clicking anything.

Is the ItemEvent the correct spot?

Thanks,

EJD

former_member201110
Active Contributor
0 Kudos

Hi Ed,

The right click event is completely separate event (ie it is not an EventType within the ItemEvent).

So to code it (C#):

private void _sboApp_RightClickEvent(ref SAPbouiCOM.ContextMenuInfo EventInfo, out bool BubbleEvent)
{
	BubbleEvent = true;

	if(EventInfo.FormUID == "MYFORM")
	{
		// Do some stuff
	}

}

You also need to have defined the event while initialising the application object:

this._sboApp.RightClickEvent += new SAPbouiCOM._IApplicationEvents_RightClickEventEventHandler(this._sboApp_RightClickEvent);

There's an example project in the UI section of the SDK samples (number 22).

Kind Regards,

Owen

AdKerremans
Active Contributor
0 Kudos

Hi,

You should add code in the before right-click to check if the itemuid is the matrix, and if not add nothing.

Regards

Ad

Former Member
0 Kudos

Ad:

Thanks for the reply. I did not realize there was a Filter for Right-Click.

I appreciate the quick response.

Thanks,

EJD