I’ll tell you what I’ve done and if someone knows a better way please let me know.
I have a form that shows records in List View. I made a button the same size as the body of the form so I could take advantage of the onRightClick event. My method shows a popup menu which works great. My problem is that the onRightClick doesn’t select the record the mouse is hovering over. I have to left-click to select the record then right-click to pull up my menu. Is it possible to select a record with a right mouse click?
Thank you for your responses. Is it possible to call “left-click”(onAction) within a method? I had the method behind right-click call the method behind left-click, but it still didn’t highlight the record. I still had to left-click to highlight the record I wanted, then right-click to run my menu.
It’s possible this is related to a ListView issue that I’ve filed in the support system, and should be fixed in the next release.
Do you have an onRecordEditStart event method on the form?
Currently, ListViews behave differently that table and record views if an onRecordEditStart method is attached to the form, requiring an extra click to select the record before you can enter a field or trigger a method.
Hi Greg,
I currently do not have an onRecordEditStart event on the form. I have now, however, noticed a new problem. When I originally posted my question, 4.0.1 hadn’t been released. We remodeled our office so I have been away from Servoy for about 2 weeks. Now that 4.0.1 is out I have noticed that my calculations are acting funny. I’ll start a new thread for that.
Here is an example of code I am using for my right-click menu:
var popup = plugins.menubar.setPopup(elements.btn_rightClick);
var item = popup.addItem();
item.set("Delete",Delete_Heading);
I have a form showing 5 headings in list view. If I left-click on heading 3 then right-click, I get a menu with a delete option for heading 3. With heading 3 still selected, if I move to heading 5 and right-click it brings up my menu with the delete option, but is still referencing heading 3. I understand right-click behavior is not implicit, so can someone give me an example of how I can select the record I want to use my popup menu on without having to select the record with a left-click, first.
I’ve come back to an old project so I’m going to bring this question back from the dead. In list view, there are 5 records shown. I have a right click method that displays a menu. I currently have to select a record with a left click, then right click to show my menu. Is there anyway to just right click to select the record and show the menu?
The fact is that by default no list-based component changes its selection on right-click. See for example lists of check boxes, or of radio buttons. Or components based on JList in Java. The default UI behavior is that you have to left-click in order to change the active selection, or change the state of the clicked item in the list. And we don’t want to change this default behavior in Servoy.
Thanks for looking into this. My client was wanting to work through his list as fast as possible and wasn’t crazy about having to essentially double-click every item to work through the menu.