getting popup menu on mouse right click

Hi All,

I need to create popupmenu on mouse right click should show menu and if click menu item open respective portlets. and appear popup menu any place in my main portlet by mouse right click

Can any one help me on this.
Regards,
Anil Kumar Ellendula

The key to this is using the Popup Panel. The Popup Panel can respond to hover, click and right-click events on any control. You can then place whatever links, text, etc… into that Panel (like any other panel).

The other item, is that i had to manually change the position property on the Popup Panel to ‘mouse’ so that the panel appears precisely where i click.

Please see the attached 8.x project for an example.
Regards,
–mark

PS: If you don’t have 8.x, you can just open up the .view file and copy and paste into a temporary 7.x project.

Regards,
–mark
PopupApp.zip (8.41 KB)

hi mark,

thanks for reply, i need popup to disply on mouse right click in any position i click in view, please help me on this., do i need to do java script to get this functionality.

Regards,
Anil Kumar Ellendula

I’m not sure how to do that. I imagine you’ll have to attach a javascript listener to the outer html of your portlet, but i’m not sure if all right click mouse events will bubble up to your event handler or not.

Regards,
–mark

Hi Mark,

i think you got what am expecting, if click mouse right click any where in my project portlet, i need to display popup menu not mouse right click on particular control like on browser mouse right click on windows shows popup i need same functionality on my portlet view if mouse right click i need to show popup which has different navigate links to go to different project portlets.

Regards,
Anil Kumar Ellendula

Ok, so do you need anything else (that i’m able to provide) on this topic?
Regards,
–mark

hi,

Any one Please help me how to get popup panel on mouse right click functionality like browser right click functionality in my portlet project.

Regards,
Anil Kumar ellendula

Just wrap your entire portlet with a Block Panel control and then add a ‘Popup Panel’ control that listens for right-click on the wrapper Block Panel.

I’ve attached a sample project that demonstrates this.

NOTE: there is an open defect in Designer for the ‘Popup Panel’ control. The ‘Position’ property of the ‘Popup Panel’ should have a ‘mouse’ as one of the position options which would cause the popup panel to be positioned where the mouse was clicked when it is shown. The workaround is to manually edit the .view xml in a text editor to set the position property to ‘mouse’.

right_click_context_test.zip (13.7 KB)

Hi Eric,

Thanks for sending sample code,.

Rgards,
Anil Kumar Ellendula