There you could explore optimization parameters of the queue and learn how them influence the Ajax requests. This example is a good start to learn about Ajax requests flood protection.

Pay attention to some points in the example:

- Setting ignoreDupResponces to true - will reduce the count of DOM updates on typing inside input. (in initial state - count of updates will be equals to count of requests)
- Disabling the queue will causes fully asynchronous updates. Note that updates could appears not in the right order and you could get wrong string in the result.
- Setting request delay to greater value will reduce the requests count on fast typing. (More similar requests will be combined in the result)

Also pay your attention to the queue definition. As it mentioned in our documentation such definition (inside some form without name) means that the queue becomes global for the form.

Queue demo

Queue provides subset of common Ajax requests optimization attributes (requestDelay, ignoreDupResponse and timeout) which you could explore at section. These attributes defined within the queue will be used for all the request in case concrete components do not override them.

The queue component also provides some additional attributes in order to control queue itself:

- name attribute which defines name for the queue.
- disabled - attribute which allows to disable the queue. Could be used in order to disable the global queue for particular views or in order to switch between same named queues with different parameters.
- size - Defines the count of requests which could be queued at the moment. -1 value means that queue has no size limit.
- sizeExceededBehavior - defines the behavior for the queue if size already exceeded and new request tried to be added to the queue. (dropNew, dropNext, fireNew, fireNext values allowed)
- status - attribute which allows to point status component to all the requests from the particular queue.

Full attributes table and usage ways you could explore at our queue documentation.

Also pay your attention to the queue definition. As it mentioned in our documentation such definition (inside some form without name) means that the queue becomes global for the form.

Note: queue component could get its parameters from EL bindings. But the component isn't designed to be updated via ajax requests. (There are no useful cases where the developers need to change the timeouts or request delays on the fly). So as you could see the example below uses h:commandButton in order to reebuild all the view and reinitialize the queue with new parameter values.