Right click event on a matrix
Hi All
I have to capture the right click event on a matrix
here is my code
<B1Listener(BoEventTypes.et_RIGHT_CLICK, True)> _
Public Overridable Function OnBeforeRightClick(ByVal pVal As ContextMenuInfo) As Boolean
Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)
'ADD YOUR ACTION CODE HERE ...
If pVal.ItemUID = "matItems" Then
' do something
End If
Return True
End Function
the problem is that pVal.ItemUID always return null.
Can any one help me
Regards
Arun TB
Edited by: aruntb on Jul 14, 2010 9:39 PM
Solved
Similar Messages
-
Right Click Event Problem in Matrix
Hi all,
I want to remove line of matrix except last line?. How i manage the DataSource after removing rows in the matrix ? If you have any samples please give me??
Regards,
Suresh.GRIGHT_CLICK_BEFOREACTION(ref SAPbouiCOM.ContextMenuInfo eventInfo, out bool BubbleEvent, SAPbouiCOM.Application oSboApplication, SAPbobsCOM.Company oCompany)
BubbleEvent = true;
oForm.EnableMenu("1293", true);
remove row one by one.
i think this will help you. -
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,
EJDHi 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 -
Hi,
Is it the right way to use the right click event to delete row in Matrix?
Could you please give me the template method for right click event?
Thank you,
Runeprivate void m_Application_EventRightClick(ref SAPbouiCOM.ContextMenuInfo oContextMenuInfo, out bool BubbleEvent)
BubbleEvent = true;
string vm_Column_ID_string = oContextMenuInfo.ColUID;
string vm_EventType_string = Convert.ToString(oContextMenuInfo.EventType);
string vm_Form_ID_string = oContextMenuInfo.FormUID;
string vm_Item_ID_string = oContextMenuInfo.ItemUID;
Int32 vm_Row_Int32 = oContextMenuInfo.Row; -
hello expert
i want to create add row functionality by right click event like in SAP B1 when we click on matrix colum it give menu for Remove,copy,add row in matrix how i do it by in my userdefiend form matrixHello,
If you enable the menu on your form Add row (menu id: 1292), Del Row (menu id: 1293 )it will automatically appear in right click .
copy should be added indivudally, and developed the functionality for each
enable them:
oForm.EnableMenu("1292", True)
oForm.EnableMenu("1293", True)
You can use MenuEvent to add/del/copy rows in the matrix or RightClickEvent
Regards,
J. -
Hi All,
What is the use of LinkTo Property in Item Object. What is the advantage of it
When the Right Click Event Fires. I tried on form but doesn't work.Hi Manish,
oItem.LinkTo is used for
1. Labels (StaticText) to get the "white line" that connects the edittext.
2. Links/Orange Arrow (LinkedButton) to connect them with a edittext. than the Arrow knows where to take
the value from
the RightClick Event is in an own EventHandler ! also be sure you enabled it in your EventFilter
lg David -
Create a right click event...
Hi,
I want to create a right click event programmatically in my Swing application.
Can anyone tell me how do I do this? I have the listener and the code that works for my required functionality, but it requires me to right click explicitly. And, I wanted to simulate a right click so that I can execute this part of the code in the listener. Is there any way to do it?
Thanks in advance...I wanted to simulate a right click so that I can execute this part of the code in the listener1) Create a method that can be invoke directly by the listener and your program.
or
2a) Create a MouseEvent
2b) use the dispatchEvent(...) method of the Component class to send the event to the object. -
hello!
is there a way to send a right click event?
After a certain action I want to open the right click menu on the current form.
any ideas?Here is my solution:
private const uint MOUSEEVENTF_RIGHTDOWN = 0x0008;
private const uint MOUSEEVENTF_RIGHTUP = 0x0010;
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern void mouse_event(
UInt32 dwFlags, // motion and click options
UInt32 dx, // horizontal position or change
UInt32 dy, // vertical position or change
UInt32 dwData, // wheel movement
IntPtr dwExtraInfo // application-defined information
public static void SendClick(System.Drawing.Point location)
System.Windows.Forms.Cursor.Position = location;
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, new System.IntPtr());
mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, new System.IntPtr());
I placed this code into the method where I want to do a rightclick (position):
SendClick(position); -
Hi all,
I am working with B1DE and the Right click Event doesn't fire at all?
anybody knows why?Yes you are correct. This is a bug and it will be fixed
in the next release of B1DE planned to appear on SDN this month. -
Right Click event name.
Hi All,
When I am doing right click on under red color rectangle( ISU data Generator) It giving three option when i clicking in first option Crete data a new sub screen is open, How to know which screen is going to call on create data screen, Not able to find through Debug Mode.Hi mohd,
In ALV tree the event for right-click is node_context_menu_request .
I hope you to find the code...
Regards -
Right click event??
Hey all,
is there an event for the right click on a canvas/datagrid
etc etc??
My context menu is rather dynamic and highly depends on the
are where the right click happened. This right click also is part
of a overall framework through my desktop OS I am developing. The
problem I am now facing is that for each
The problem currently is that for each ItemRollOver this
event's get fires and a new context menu get's created. I rather do
this before the context menu get's displayed (only once).
Is this possible at all or is it that using a context menu is
jats not a good idea because Adobe Flash is managing that?
Ries@Greg: This is based on Flex and I couldn't see how I can
respond to a right click, they also don't seem to be available on
the components in general.
@ericbelair: Thanks for the link but the demo shows that the
context menu was already created during initialization.
In my case I need to generate the context menu when the right
mouse is pressed and before the menu is displayed.
Ries -
Make Double Click event on Row, Matrix
Hi All,
I'm new in SDK and sorry for my English.
Please show me how to make double click event on Row of Matrix, i have created a table contain all Draft which Docstatus is open and order by ObjType(DocType), but i can't using Link Button on DocNum Column to view Object Detail . I think another way to do that is make a double click event on each row of matrix. Can I do like that ? plz show me . Thank for any suggestion.
ThanksHi Shafi,
This is my .srf file
<items><action type="add"><item uid="MTX_Data" type="127" left="15" tab_order="0" width="620" top="41" height="285" visible="1" enabled="1" from_pane="0" to_pane="0" disp_desc="0" right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1"><AutoManagedAttribute /><specific SelectionMode="2" layout="0" titleHeight="19" cellHeight="19" TabOrder="0">
This is my code draw a form with matrix
Private Sub DrawForm()
Try
'Read File interface
LoadFromXML("DraftOpen.srf")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
oForm = SBO_Application.Forms.Item("DRFOPEN")
' Add Items
' Add a matrix
oMatrix = oForm.Items.Item("MTX_Data").Specific
oMatrix.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single
This is my event
Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
If pVal.FormUID = "DRFOPEN" And pVal.ItemUID = "MTX_Data" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_DOUBLE_CLICK And pVal.BeforeAction = True Then
Try
oForm = SBO_Application.Forms.Item("DRFOPEN")
Dim omatrix As SAPbouiCOM.Matrix
omatrix = oForm.Items.Item("MTX_Data").Specific
If omatrix.RowCount > 0 Then
For i As Integer = 1 To omatrix.RowCount
If omatrix.IsRowSelected(i) = True Then
MessageBox.Show(omatrix.Columns.Item(1).Cells.Item(pVal.Row).Specific.value)
MessageBox.Show(omatrix.Columns.Item(2).Cells.Item(pVal.Row).Specific.value)
End If
Next
End If
Catch ex As Exception
SBO_Application.MessageBox(ex.Message)
End Try
End If
please help me to check this code. i don't know why it's still not working with double click event. sorry to disturb you.
Edited by: PeterHoang on Aug 30, 2011 10:15 AM -
How can i disable mouse right clicking event
I need in my project to disallow any body to right click the mouse. Can i disable this event to prevent user of the application from right clicking if yes how can i disable it.
I have code written in Visual Basic doing the same task but i don't know how to transfer those code in java
The following is a code for that:
Option Explicit
'declares
Public Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
Public Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
Public Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal nCode As Long, ByVal wParam As Long, lParam As Any) As Long
'constant
Private Const WH_MOUSE_LL = 14&
Public Const HC_ACTION = 0&
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_RBUTTONUP = &H205
Public Const VK_RBUTTON = &H2
Private lMShook As Long
Private bHookEnabled As Boolean
'functions which process mouse events
Public Function MouseProc(ByVal nCode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If nCode = HC_ACTION Then
If (wParam = WM_RBUTTONUP Or wParam = WM_RBUTTONDOWN) Then
MouseProc = 1
Exit Function
End If
End If
MouseProc = CallNextHookEx(lMShook, nCode, wParam, lParam)
End Function
Public Function SetHook()
If lMShook = 0 Then
lMShook = SetWindowsHookEx(WH_MOUSE_LL, AddressOf MouseProc, App.hInstance, 0&)
End If
If lMShook = 0 Then
MsgBox "failed to install hook :" & lMShook & " : " & WH_MOUSE_LL
bHookEnabled = False
Unload Form1
Exit Function
Else
bHookEnabled = True
End If
End Function
Public Function UnSetHook()
If bHookEnabled Then
Call UnhookWindowsHookEx(lMShook)
lMShook = 0
End If
bHookEnabled = False
End Function
Public Function InstalledHook()
MsgBox " installed hook is :" & lMShook
End Function
code for form is below:
Option Explicit
Private Sub Command1_Click()
InstalledHook
End Sub
Private Sub Command2_Click()
Call SetHook
End Sub
Private Sub Command3_Click()
Call UnSetHook
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call UnSetHook
End Sub -
Stop right click Event on JTabbedPane
Hi,
Does anyone know how to stop tabbed pane changing by right click of the mouse? I still want left click to change.
Thanks a lot.
QianThe proper way to do this is to write a custom UI as this behaviour is controlled by the UI.
As a quick hack you can replace the deault MouseListener with a custom MouseListener. The listener code below was taken from the BasicTabbedPaneUI and slightly modified:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class TabbedPaneNoRightClick extends JFrame
public TabbedPaneNoRightClick()
JTabbedPane tabbedPane = new JTabbedPane();
getContentPane().add(tabbedPane);
newTab(tabbedPane, "one");
newTab(tabbedPane, "two");
newTab(tabbedPane, "three");
newTab(tabbedPane, "four");
MouseListener[] ml = (MouseListener[])tabbedPane.getListeners(MouseListener.class);
for (int i = 0; i < ml.length; i++)
tabbedPane.removeMouseListener( ml[i] );
tabbedPane.addMouseListener(new MouseAdapter()
public void mousePressed(MouseEvent e)
JTabbedPane tabbedPane = (JTabbedPane)e.getSource();
if (!tabbedPane.isEnabled()
|| SwingUtilities.isRightMouseButton( e )) // added
return;
// int tabIndex = getTabAtLocation(e.getX(), e.getY()); // changed
int tabIndex = tabbedPane.getUI().tabForCoordinate(tabbedPane, e.getX(), e.getY());
if (tabIndex >= 0 && tabbedPane.isEnabledAt(tabIndex))
if (tabIndex == tabbedPane.getSelectedIndex())
if (tabbedPane.isRequestFocusEnabled())
tabbedPane.requestFocus();
//tabbedPane.repaint(getTabBounds(tabPane, tabIndex)); // changed
tabbedPane.repaint(tabbedPane.getUI().getTabBounds(tabbedPane, tabIndex));
} else
tabbedPane.setSelectedIndex(tabIndex);
private void newTab(JTabbedPane tabbedPane, String text)
JLabel label = new JLabel(text);
tabbedPane.addTab( text, label );
public static void main(String args[])
TabbedPaneNoRightClick frame = new TabbedPaneNoRightClick();
frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
frame.setSize(200, 100);
frame.setLocationRelativeTo( null );
frame.setVisible(true);
} -
Hi friends
i want to write some code on event that is right click of a cell. is it possible.
thanksYes, its possible.
Eventtype = et_RIGHT_CLICK
BeforeAction = True
ItemUID = matrixID
ColUID = columnID
then in pval.row you will have the row number, where user clicked with right click.
Maybe you are looking for
-
Loading a text file into Terminal App
Hi, I am trying to load a textfile into my Terminal App using the Import utility under the Shell drop down menu. But when I try choosing the text files after clicking Import, I am unable to select a text file b
-
File to File output not received using BPM
Hi... I am doing simple File to File scenario using BPM. Everything id fine. But i am not getting output in receiver side.Could you please help me out in this issue. Thanks Leela
-
Can anyone tell me WHY Oracle won't allow sub-queries in outer joins?
Hi, I've recently been tasked with converting a series of InterBase dbs to Oracle. Many of the queries in the InterBase dbs use sub-queries in outer joins. Oracle won't countenance this (01799 - a column may not be outer-joined to a subquery). I can
-
HI, I would like to configre the following scenario. I am selling material to sold to party 1000, ship to party 1000.The customer has rejected the material . But there is another ship to party for 1000 is 2000 who has got authorisation to return th
-
Glitch and LOss of 2 songs...
I purshased the song by auburn call lalala, and the album art for the auburn song also shows for the 8 other songs that i pujrchased after thhis song, does anyone know what i have to do to fix this.... and I also so know do not have this song any mor