• 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

Hotkey

Hotkey is used to bind a key or a key combination to an client side or server side event via ajax. In first example use "left" and "right" keys to switch images and in second example you can do an ajax request with the (ctrl+shift+s) combination.

Hotkey Tag Documentation

HotKey is a generic key binding component that can bind any formation of keys to javascript event handlers or ajax calls

NameTypeRequiredDefaultDescription
id String false generated Unique identifier of the component in a namingContainer.
rendered boolean false true Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding UIComponent false generated An EL expression referring to a server side UIComponent instance in a backing bean.
action MethodExpression false A method expression or a string outcome to process when command is executed.
actionListener ActionListener false An action listener to process when command is executed.
async boolean false false When set to true, ajax requests are not queued.
bind String true The key binding.
bindMac String false An alternative key binding for macOS.
delay String false If less than delay milliseconds elapses between calls to request() only the most recent one is sent and all other requests are discarded. If this option is not specified, or if the value of delay is the literal string 'none' without the quotes, no delay is used.
disabled boolean false false Disables the hotKey binding.
form String false The enclosing form Form to serialize for an ajax request.
global boolean false true Global ajax requests are listened by ajaxStatus component, setting global to false will not trigger ajaxStatus.
handler String false Javascript event handler to be executed when the key binding is pressed.
ignoreAutoUpdate boolean false false If true, components which autoUpdate="true" will not be updated for this request. If not specified, or the value is false, no such indication is made.
ignoreComponentNotFound boolean false false If true, unresolvable components (ComponentNotFoundException) referenced in the update/process attribute are ignored.
immediate boolean false false When set true, process validations logic is executed at apply request values phase for this component.
oncomplete String false Client-side javascript callback to execute when ajax request is completed.
onerror String false Client-side javascript callback to execute when ajax request fails.
onstart String false Client-side javascript callback to execute before ajax request begins.
onsuccess String false Client-side javascript callback to execute when ajax request succeeds.
partialSubmit boolean false false Enables serialization of values belonging to the partially processed components only.
partialSubmitFilter String false Selector to use when partial submit is on, default is ":input" to select all descendant inputs of a partially processed components.
process String false Component(s) to process in partial request.
resetValues boolean false false If true, local values of input components to be updated within the ajax request would be reset.
timeout int false 0 Timeout in milliseconds for ajax request, whereas 0 means no timeout.
update String false Component(s) to update with ajax.
value Object false Value of the component.
Loading...
Tag DocumentationNew DocumentationNew Documentation JSDoc
ImageSwitch Integration (Left-Right)
Ajax Hotkey (ctrl + shift + s)

Usage


<div class="card">
    <h:form>
        <h5 class="p-mt-top">ImageSwitch Integration (Left-Right)</h5>
        <p:imageSwitch effect="fade" widgetVar="switcher" slideshowAuto="false">
            <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:hotkey bind="left" handler="PF('switcher').previous()"/>
        <p:hotkey bind="right" handler="PF('switcher').next()"/>

        <h5>Ajax Hotkey (ctrl + shift + s)</h5>
        <p:growl id="msgs" showDetail="true" skipDetailIfEqualsSummary="true"/>

        <p:hotkey bind="ctrl+shift+s" update="msgs" action="#{hotkeyView.save}"/>

        <h:panelGrid columns="2" cellpadding="7">
            <p:outputLabel for="text" value="Text"/>
            <p:inputText id="text" value="#{hotkeyView.text}"/>
        </h:panelGrid>
    </h:form>
</div>