Project Documentation

Summary

Tag name: <tr:poll>
UIComponent class: org.apache.myfaces.trinidad.component.core.CorePoll
Component type: org.apache.myfaces.trinidad.CorePoll

The poll element triggers an event after the time interval specified by the interval attribute (in milliseconds). On the server, the org.apache.myfaces.trinidad.event.PollEvent is queued and the listeners get a chance to update the model, refresh components, or even display a dialog in response to this event. The components that have listed this poll component as a partiaTrigger get a chance to re-render themselves. The poll component automatically uses Partial Page Rendering (PPR) if available.

Events

Type Phases Description
org.apache.myfaces.trinidad.event.PollEventApply Request Values,
Invoke Application
Event delivered when the poll component polls the server.
org.apache.myfaces.trinidad.event.AttributeChangeEventInvoke Application,
Apply Request Values
Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change event might include the width of a column that supported client-side resizing.

Attributes

Name Type Supports EL? Description
attributeChangeListenerjavax.el.MethodExpressionOnly EL a method reference to an attribute change listener. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change events might include the width of a column that supported client-side resizing.
bindingorg.apache.myfaces.trinidad.component.core.CorePollOnly EL an EL reference that will store the component instance on a bean. This can be used to give programmatic access to a component from a backing bean, or to move creation of the component to a backing bean.
idStringNo the identifier for the component. The identifier must follow a subset of the syntax allowed in HTML:
  • Must not be a zero-length String.
  • First character must be an ASCII letter (A-Za-z) or an underscore ('_').
  • Subsequent characters must be an ASCII letter or digit (A-Za-z0-9), an underscore ('_'), or a dash ('-').
immediatebooleanYes Default Value: false

whether data validation should be skipped when poll events are generated by this component. When immediate is false (the default), events will be delivered during the Invoke Application phase, which will trigger validation. When set to true, events will be executed during the Apply Request Values phase.
intervalintYes Default Value: 5000

the time between poll events, in milliseconds. The default is 5000. If in screen-reader mode, make sure the interval is long enough for the screen reader to read through the re-render before a new poll occurs.
pollListenerjavax.el.MethodExpressionOnly EL a method reference to a poll listener
renderedbooleanYes Default Value: true

whether the component is rendered. When set to false, no output will be delivered for this component (the component will not in any way be rendered, and cannot be made visible on the client). If you want to change a component's rendered attribute from false to true using PPR, set the partialTrigger attribute of its parent component so the parent refreshes and in turn will render this component.