Author: ilya_shaikovsky
Date: 2008-05-20 07:42:14 -0400 (Tue, 20 May 2008)
New Revision: 8651
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/push/PushBean.java
trunk/samples/richfaces-demo/src/main/webapp/richfaces/push/examples/push.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/push/usage.xhtml
Log:
push example corrections and description.
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/push/PushBean.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/push/PushBean.java 2008-05-20
11:18:31 UTC (rev 8650)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/push/PushBean.java 2008-05-20
11:42:14 UTC (rev 8651)
@@ -31,7 +31,6 @@
public void addListener(EventListener listener) {
synchronized (listener) {
- System.out.println("PushBean.addListener()");
if (this.listener != listener) {
this.listener = (PushEventListener) listener;
}
@@ -39,11 +38,9 @@
}
public void run() {
- System.out.println("PushBean.run() executed");
while (thread != null) {
try {
- System.out.println(((new Date()).getTime()-startDate.getTime())>=60000);
- if (((new Date()).getTime()-startDate.getTime())>=20000) {
+ if (((new Date()).getTime()-startDate.getTime())>=60000) {
stop();
}
uuid = UUID.randomUUID().toString();
@@ -57,7 +54,6 @@
}
public String getUuid() {
- System.out.println(uuid + "returned");
return uuid;
}
@@ -66,10 +62,8 @@
thread = new Thread(this);
thread.setDaemon(true);
thread.start();
- System.out.println("PushBean.start()");
setStartDate(new Date());
setEnabled(true);
- System.out.println("thread started");
}
}
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/push/examples/push.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/push/examples/push.xhtml 2008-05-20
11:18:31 UTC (rev 8650)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/push/examples/push.xhtml 2008-05-20
11:42:14 UTC (rev 8651)
@@ -20,9 +20,9 @@
</h:panelGroup>
<h:panelGroup>
<a4j:commandButton value="Start" action="#{push.start}"
- ajaxSingle="true" rendered="#{!push.enabled}"
reRender="push"/>
+ ajaxSingle="true" rendered="#{!push.enabled}"
reRender="push, out"/>
<a4j:commandButton value="Stop" action="#{push.stop}"
- ajaxSingle="true" rendered="#{push.enabled}"
reRender="push"/>
+ ajaxSingle="true" rendered="#{push.enabled}"
reRender="push, out"/>
</h:panelGroup>
</h:panelGrid>
</rich:panel>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/push/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/push/usage.xhtml 2008-05-20
11:18:31 UTC (rev 8650)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/push/usage.xhtml 2008-05-20
11:42:14 UTC (rev 8651)
@@ -58,17 +58,34 @@
<p>Thus, component 'push' uses asynchronous model instead of
polls.</p>
<p>
- Push example using <b>Runabble</b> interface (should be described.)
+ There is simple <b>Push </b>example using <b>Runabble</b>
interface.
</p>
+ <p>
+ When you hit <b>Start</b> button new Thread will be started and alive
+ for a minute. It will generate random Uuid once in a ten seconds.
+ </p>
+ <p>
+ Push component will fire the request after uuid generation event sent
+ and update the output field displaying new uuid value.
+ </p>
<fieldset class="demo_fieldset"><legend
class="demo_legend">Push Demo</legend>
<div class="sample-container"><ui:include
- src="/richfaces/push/examples/push.xhtml" /> <ui:include
- src="/templates/include/sourceview.xhtml">
+ src="/richfaces/push/examples/push.xhtml" />
+
+ <ui:include src="/templates/include/sourceview.xhtml">
<ui:param name="sourcepath"
value="/richfaces/push/examples/push.xhtml" />
<ui:param name="openlabel" value="View Page Source" />
- </ui:include></div>
+ </ui:include>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath"
+ value="/richfaces/push/snippets/PushBean.java" />
+ <ui:param name="openlabel" value="View PushBean code" />
+ <ui:param name="sourcetype" value="java" />
+ </ui:include>
+
+ </div>
</fieldset>
</ui:define>
Show replies by date