Component LONGPOLLING

Overview

The component LONGPOLLING is an invisible component that listens to server side events.

Internally the component opens up an own http-connection to the server, which waits for an event to occur. If the event occurs then the http response is passed back to the component so that the component itself will trigger the associated ACTIONLISTENER.

On server side there is a corresponding structure that simplifies the creation of http-endpoints significantly: you need to implement a class extending "DefaultLongPolling" and register an instance of this class in the "LongPollingMgr". The URL that is required by the component is a property of the instance as well.

Please note: there is a component WEBSOCKETPOLLING doing exactly the same thing, which is based on much more lightweight websocket communication. In case of websockest being usable in your scenario we recommend to use the WEBSOCKETPOLLING component.

Attribute summary

Typically used attributes

All attributes are

General attributes are

Positioning

Used inside: BEANPROCESSING

Attribute details

actionListener

Binding to server side method that processes the events coming from this component.

#{methodBinding}Method binding

attributemacro

Name of macro that is used for generating certain attributes of this component. Please pay attention: the value of this attribute is read one time for each control and cannot be changed afterwards.

avoidvalidations

When a roundtrip is triggered then by default the curren user input is validated. This may lead to some change within the current user input field (e.g. is user just defines a date then the user might not yet have specified a correct date).

falseValidations are executed (default)
trueValidations are not executed

clientname

Name that is assigned to the component at client side: there is no specific function associated with the name - but it can be used on client side to describe the component in a clearer way. The name is e.g. used by UI test tools that replay certain user interaction sequences - and that reference components via their name.

comment

Comment that can be asigned to any component. The comment is not operationally used.

Any textAny text

configinfo

Configuration information that is attached to this component. This information is not functionally used by CaptainCasa, but may be used for any application specific purpose.

duration

Duration in milliseconds after which a request to the client is triggered. In case of TIMER components this is the actual polling duration (every xxx milliseconds), in case of LONGPOLLING components this is the duration after which the new polling request is sent to the server (in order to avoid, that there are too many requests).

0Deactivated
10001000 milliseconds
20002000 milliseconds

longpollingport

Definition of an explicit port for the long polling request that is sent from the client to the server. When using relative ports (which is default) then by default the port of the JSF connection is used also for long polling requests. By using LONGPOLLINGPORT you can override this. You may use a different port for long polling if you e.g. have different technology processing the requests on server side. Example: the normal JSF requests are addressed to some normal http1.1 port, but the long polling request are sent to some port supporting Comet/Java NIO based request processing.

longpollingurl

URL that is used by the client to poll for an event on server side. The URL is typically derived from an extension of DefaultLongPolling in server side.

reference

Reference to an outside object that is the content behind the component. E.g. a field is representing a certain field of a database table: in this case you could define the value table;column. The reference plays a siginficant role within the attributemacro management.

refOne reference
ref1;ref2Two references
ref1;ref2;ref3Three references

rendered

Flag that indicated if this component is rendered at all. If set to false then the component is not rendered - there is no component data sent to the client.

trueComponent is rendered (default)
falseComponent is not rendered

restarttrigger

statusbarneutral

If set to true, then the roundtrip that is caused by the component does NOT clear the current statusbar content.

falseStatusbar content is cleared. (default)
trueStatusbar content is kept.

stylevariant

In CaptainCasa you can define styles definitions for components. A style definition is a definition of a set of default attribute values that are applied to the component. In case you want to differenciate between different usage types of the component you can apply multiple styles - and use the stylevariant attribute to select between.