• Settings
    • Locale
    • Change the locale of the datepicker, schedule and client side validation messages.

      Language
      English
      English
      English
      French
      German
      German
      German
      Italian
      Korean
      Spanish
      Catalan
      Dutch
      Portuguese
      Portuguese
      Arabic
      Arabic
      Bulgarian
      Bangla
      Bosnian
      Czech
      Greek
      Estonian
      Persian
      Finnish
      Danish
      Hindi
      Indonesian
      Icelandic
      Croatian
      Japanese
      Hungarian
      Hebrew
      Georgian
      Central Kurdish
      Khmer
      Kyrgyz
      Kazakh
      Lithuanian
      Latvian
      Malay
      Norwegian
      Polish
      Romanian
      Russian
      Slovak
      Slovenian
      Serbian
      Serbian
      Swedish
      Thai
      Turkish
      Ukrainian
      Uzbek
      Vietnamese
      Chinese
      Chinese
  • Resources

ContextMenu Target

ContextMenu can be attached to any component, right-click on ImageSwitch component for options.

ContextMenu Tag Documentation

ContextMenu provides an overlay menu displayed on mouse right-click event.

NameTypeRequiredDefaultDescription
widgetVar String false generated ('widget_' + componentClientId) Name of the client side widget.
touchable Boolean false Enable touch if supported by device. NULL uses global default or primefaces.TOUCHABLE. Default: globally enabled.
toggleEvent String false Event to toggle the submenus, valid values are "hover" and "click".
targetFilter String false Selector to filter the elements to attach the menu.
tabindex String false 0 Position of the element in the tabbing order.
styleClass String false Style class of the component.
style String false Inline style of the component.
showDelay int false 0 Delay in milliseconds before displaying the submenu. Default is 0 meaning immediate.
selectionMode String false multiple Defines the selection behavior, e.g., "single" or "multiple".
rendered boolean false true Boolean value to specify the rendering of the component, when set to false component will not be rendered.
nodeType String false Specific type of tree nodes to attach to.
model MenuModel false Menu model instance to create menu programmatically.
id String false generated Unique identifier of the component in a namingContainer.
hideDelay int false 0 Delay in milliseconds before hiding the submenu, if 0 not hidden until document.click().
for String false Id of the component to attach to
event String false Event to bind contextMenu display, default is contextmenu aka right click.
disabled boolean false false If true, prevents menu from being shown
dir String false ltr Defines text direction, valid values are ltr and rtl.
binding UIComponent false generated An EL expression referring to a server side UIComponent instance in a backing bean.
beforeShow String false Client side callback to execute before showing.
autoDisplay boolean false true Defines whether the first level of submenus will be displayed on mouseover or click event.
appendTo String false @(body) Search expression for the element to which the menu overlay is appended.
Loading...
Tag Documentation Documentation Documentation JSDoc Basic Tiered Target DataTable Tree TreeTable

Usage


<div class="card">
    <p:imageSwitch id="images" effect="fade" widgetVar="gallery" slideshowAuto="false" styleClass="shadow-2">
        <p:graphicImage name="/demo/images/nature/nature1.jpg"/>
        <p:graphicImage name="/demo/images/nature/nature2.jpg"/>
        <p:graphicImage name="/demo/images/nature/nature3.jpg"/>
        <p:graphicImage name="/demo/images/nature/nature4.jpg"/>
    </p:imageSwitch>

    <p:contextMenu for="images">
        <p:menuitem value="Prev" url="javascript:void(0)" onclick="PF('gallery').previous()"
                    icon="pi pi-chevron-left"/>
        <p:menuitem value="Next" url="javascript:void(0)" onclick="PF('gallery').next()"
                    icon="pi pi-chevron-right"/>
        <p:menuitem value="Remove" url="javascript:void(0)" onclick="PF('gallery').getJQ().fadeOut()"
                    icon="pi pi-times"/>
    </p:contextMenu>
</div>