Author: jbalunas(a)redhat.com
Date: 2011-03-15 15:00:35 -0400 (Tue, 15 Mar 2011)
New Revision: 22228
Modified:
branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/attachQueue/attachQueue.xhtml
branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/queue/queue.xhtml
Log:
RFPL-1211 updates to showcase text
Modified:
branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/attachQueue/attachQueue.xhtml
===================================================================
---
branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/attachQueue/attachQueue.xhtml 2011-03-15
17:29:41 UTC (rev 22227)
+++
branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/attachQueue/attachQueue.xhtml 2011-03-15
19:00:35 UTC (rev 22228)
@@ -3,14 +3,16 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j">
- <p>In RichFaces 4 all request settings related to queue was moved
- out of components attributes and now customization available using new
- <b>a4j:attachQueue</b> tag. Next sample shows how
<b>requestDelay</b>
- could be changed for single component.</p>
- <p>Note that when you typing in input - status appears with two
- seconds delay because <b>default queue contains
requestDelay="2000"</b>.
- And when you clicking save button - it appears immediately because
<b>requestDelay
- changed to 0 for the button</b>.</p>
+ <p>The <b>a4j:attachQueue</b> component allow you to funnel requests
+ from specific components or behaviors through a 'named' queue (see queue
+ example), but also allows you to override queue settings right from the
+ component. </p>
+ <p>This sample shows how <b>requestDelay</b>
+ can be changed for single component.</p>
+ <p>Note that when you are typing in the input - the status appears with a two
+ seconds delay because the <b>default queue contains
requestDelay="2000"</b>.
+ However when you are clicking the save button - it appears immediately
+ because <b>requestDelay changed to 0 for the button</b>.</p>
<ui:include src="#{demoNavigator.sampleIncludeURI}" />
<ui:include src="/templates/includes/source-view.xhtml">
<ui:param name="src" value="#{demoNavigator.sampleIncludeURI}"
/>
Modified:
branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/queue/queue.xhtml
===================================================================
---
branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/queue/queue.xhtml 2011-03-15
17:29:41 UTC (rev 22227)
+++
branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/queue/queue.xhtml 2011-03-15
19:00:35 UTC (rev 22228)
@@ -3,31 +3,32 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
- <p>JSF 2 provides queue mechanism out-of the box already. And
- RichFaces queue just provides some additional customizations to improve
- the queue usability and allow to tune your performance while using Ajax
- as much as possible.</p>
- <p>The only big difference which the developers who used queue in
- 3.3.x should remember: as JSF 2 already provides single queue and not
- allows to have more than one queue instance(currently) you can't really
- fire concurrent requests anymore. So the queue in RF now not actually
- defines logical queue but just a component for defining queueing
- options.</p>
- <p>Here you could explore additional optimization parameters of the
- queue and learn how they influence Ajax requests. This example is a
- good start to learn about Ajax requests flood protection.</p>
+ <p>JSF 2 provides a queuing mechanism out-of the box in order to sequence
+ client side events with the built-in Ajax implementation. This queue is
+ lacking in some very essential tuning options. The RichFaces
+ <b>a4j:queue</b> provides these basic options in addition to other
+ enhancements. There are two primary options available; 'requestDelay' and
+ 'ignoreDupResponse'. These are explained more in the example below.</p>
+ <p>Many of the features of the RichFaces 3.3.X queue have been ported to
+ RichFaces 4.0 version. However it is important to remember that the 4.0
+ queue is a logical queue on top of JSF's. There is only a single physical
+ queue allowed and there is no way to override that (for now).</p>
+ <p>In this example you can tweak different queue options and see what effect
+ that has on the number of events fired, and how often the DOM is updated.
+ This provides a good way to learn about Ajax requests flood protection.</p>
- <p>Pay attention to next point in the example:</p>
+ <p>Attribute details:</p>
<ul>
- <li>Setting <b>requestDelay</b> to greater value reduces the greatly
- requests count on fast typing. (More similar requests are combined in
- the result)</li>
- <li>Setting requestDelay to smaller value(just for easier exploration) but using
<b>ignoreDupResponse</b> flag set to true
- - reduces greatly DOM updates count.</li>
+ <li><b>requestDelay</b> is the number of milliseconds to wait before
+ sending a request in order to combine similar requests. The greater the
+ value the fewer requests will be sent when fast typing. Similar requests
+ in the queue are combined while waiting for the request delay</li>
+ <li>If <b>ignoreDupResponse</b> is true then RichFaces will not waste
+ time updating the client side DOM if it knows another request for the same
+ thing is pending. The best way to see that in this demo is set
+ requestDelay to a very small value and type quickly. You will see the
+ number of DOM updates be smaller than requests sent.</li>
</ul>
- <p>Also pay your attention to the queue definition. Such definition
- (inside some form without a name) means that the queue options becomes
- global for the form.</p>
<ui:include src="#{demoNavigator.sampleIncludeURI}" />
<ui:include src="/templates/includes/source-view.xhtml">
@@ -36,17 +37,19 @@
<ui:param name="openLabel" value="View Source" />
<ui:param name="hideLabel" value="Hide Source" />
</ui:include>
- <p>Queue could be defined as</p>
+ <p><b>Queue scopes, and names:</b></p>
+ <p>You can define a queue so that it is the default queue for all requests
+ from a complete view, a specific form, or even specific components.</p>
<ul>
- <li><b>Default for view.</b> In this case - the parameters will
- be used for all the Ajax requests in view(if not redefined). In order
- to define such queue - just place <b>a4j:queu</b> outside of any forms
- without defining <b>name</b></li>
- <li><b>Default for form.</b> Similar to view-scoped but should be
- defiend in some form without defining <b>name</b></li>
- <li><b>Referenced from ajax behaviors/components.</b> Queue
- should be defined with name and referenced using attachQueue tag(see
- corresponding sample).</li>
+ <li><b>View scoped:</b> Place an <b>a4j:queue</b> with no
name
+ attribute outside of any form, and it will be the default
+ queue for all requests on the page.</li>
+ <li><b>Form scoped</b> Place a nameless <b>a4j:queue</b>
within a form
+ to make it the default queue for all requests within it.</li>
+ <li><b>Named queue</b> Define an <b>a4j:queue</b> with a
specific name.
+ Then you can make any component, or behavior use that queue with the
+ <b>a4j:attachQueue</b> component. See the next queue example for details.
+ </li>
</ul>
</ui:composition>