Poll (<b:poll >)

<b:poll /> refreshes a part of the screen periodically. It can also call an action or an actionListener.

Basic usage

Current time: Tue Apr 16 17:27:04 UTC 2024

AJAXbreaking change in 1.1.2

Prior to BootsFaces 1.1.2, the attributes update and execute where simply passed to the HTML code. Since 1.1.2, they are evaluated by the advanced search expression engine of BootsFaces, as they should. However, this may break programs relying on the bug (such as this showcase).

JavaScript APIsince 1.1.2

You can access the JavaScript API by setting the widgetVar attribute. This attribute is the name of the JavaScript object implementing <b:poll /> on the client side. Currently, the public API consists of a stop and (re)start function:

  • widgetVar.stop() allows you to stop polling from JavaScript.
  • widgetVar.start() allows you to (re)start polling from JavaScript.
Current time:
Tue Apr 16 17:27:04 UTC 2024
Counter:

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).
auto-update
autoUpdate (alternative writing)
false Setting this flag updates the widget on every AJAX request.
execute (none) Which input fields are to be sent? Default value: @none
id (none) Unique identifier of the component in a namingContainer.
interval 0 How often is the poll action to be called? Denotes the number of milliseconds between polls. Default value is 1000.
once false If true, the poll is called only once. Default value: false.
rendered false Boolean value to specify the rendering of the component, when set to false the component will not be rendered.
stop false If true, the poll will stop. Default value: false.
update (none) Which region of the screen is to be updated? Default value: @form
widgetVar (none) Optional widget variable to access the poll widget in JavaScript code.