Shake (<b:shake />)planned for 0.9.0

<b:shake> is a JSF component that detects when your device is shaken. It goes without saying that this only works on devices with a motion sensor. Typically, smartphones and many tablet computers have such a sensor.

Basic usage

<b:shake /> only takes a singe parameter: onshake. That's a JavaScript function.

Live demo

Open this page on a mobile device and shake it. A JSF alert box should show. This is the source code needed:

Reference section

Attribute Default value Description
action (none) The button action, this can be method expression or a string outcome.
action-listener
actionListener (alternative writing)
(none) A method expression that refers to a method with this signature: void methodName(Action-Event).
ajax false Whether the Button submits the form with AJAX.
delay (none) Delays the AJAX request.
disabled false Disables the input element, default is false.
id (none) Unique identifier of the component in a namingContainer.
interval 500 Specifies the delay (in milliseconds) between each slide.
oncomplete (none) JavaScript to be executed when ajax completes with success.
onshake (none) A method binding expression referring to a method for handling a valuechangeevent.
process (none) Comma or space separated list of ids or search expressions denoting which values are to be sent to the server.
threshold 15 Specifies the sensitivity of the skae detector.
update (none) Component(s) to be updated with ajax.
  • Tell the world which CSS classes can be used to change the look of the component.