Class InputBehavior

java.lang.Object
org.apache.wicket.behavior.Behavior
wicket.contrib.input.events.InputBehavior
All Implemented Interfaces:
Serializable, IComponentAwareEventSink, IComponentAwareHeaderContributor, IClusterable

public class InputBehavior extends Behavior
Add this to your button, link whatever to create a shortcut key.. WARNING:this behavior uses a special script for calling window.onload
Author:
Nino Martinez (nino.martinez.wael *at* gmail *dot* com remember no stars)
See Also:
  • Constructor Details

    • InputBehavior

      public InputBehavior(KeyType[] keyCombo, EventType eventType)
    • InputBehavior

      public InputBehavior(KeyType[] keyCombo)
      if using auto hook be sure to add this behavior last, otherwise it might not pickup the event.. Also it will only hook up to the last event if more are present (use other constructor to specify manually) Note on keyCombo The shortcut keys should be specified in this format ... Modifier[+Modifier..]+Key Meaning that you should specify in this order, modifier keys first like 'ctrl' and then normal keys like 'a'
      Parameters:
      keyCombo -
  • Method Details

    • bind

      public void bind(Component component)
      Overrides:
      bind in class Behavior
    • getEscapedComponentMarkupId

      protected final String getEscapedComponentMarkupId()
      Gets the escaped DOM id that the input will get attached to. All non word characters (\W) will be removed from the string.
      Returns:
      The DOM id of the input - same as the component's markup id}
    • renderHead

      public void renderHead(Component c, IHeaderResponse response)
      Specified by:
      renderHead in interface IComponentAwareHeaderContributor
      Overrides:
      renderHead in class Behavior
    • onComponentTag

      public void onComponentTag(Component component, ComponentTag tag)
      Overrides:
      onComponentTag in class Behavior
    • afterRender

      public void afterRender(Component component)
      Overrides:
      afterRender in class Behavior
    • getDisable_in_input

      protected Boolean getDisable_in_input()
      If this is set to true, keyboard capture will be disabled in input and textarea fields. If these elements have focus, the keyboard shortcut will not work. This is very useful for single key shortcuts. Default: false
      Returns:
    • getType

      protected KeyHookOn getType()
      The event type - can be 'keydown','keyup','keypress'. Default: 'keydown'
      Returns:
    • getPropagate

      protected Boolean getPropagate()
      Should the command be passed onto the browser afterwards?
      Returns:
    • getTarget

      protected String getTarget()
      target - DOM Node The element that should be watched for the keyboard event. Default : document
      Returns: