Author: mvitenkov
Date: 2008-11-28 08:30:10 -0500 (Fri, 28 Nov 2008)
New Revision: 11432
Modified:
trunk/test-applications/jsp/src/main/java/queue/Queue.java
trunk/test-applications/jsp/src/main/webapp/CustomizePage/CustomizePage.jsp
trunk/test-applications/jsp/src/main/webapp/Queue/Queue.jsp
trunk/test-applications/jsp/src/main/webapp/Queue/QueueProperty.jsp
trunk/test-applications/jsp/src/main/webapp/Queue/QueueStraightforward.jsp
trunk/test-applications/jsp/src/main/webapp/pages/Rich/Rich.jsp
Log:
Queue correction
Modified: trunk/test-applications/jsp/src/main/java/queue/Queue.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/queue/Queue.java 2008-11-28 13:24:40 UTC
(rev 11431)
+++ trunk/test-applications/jsp/src/main/java/queue/Queue.java 2008-11-28 13:30:10 UTC
(rev 11432)
@@ -1,9 +1,13 @@
package queue;
+import java.util.ArrayList;
+
+import javax.faces.model.SelectItem;
+
import org.ajax4jsf.component.UIQueue;
import util.componentInfo.ComponentInfo;
-public class Queue {
+public class Queue{
private UIQueue myQueue = null;
private boolean disabled;
private boolean ignoreDupResponses;
@@ -13,6 +17,7 @@
private int size;
private String sizeExceededBehavior;
private int timeout;
+ private ArrayList<SelectItem> behaviors;
public Queue(){
this.disabled = false;
@@ -23,6 +28,12 @@
this.size = 3;
this.sizeExceededBehavior = "dropNext";
this.timeout = 5000;
+
+ behaviors = new ArrayList<SelectItem>();
+ String[] sizeExceededBehaviors = {"dropNext", "dropNew",
"fireNext", "fireNew"};
+ for(int i=0;i<sizeExceededBehaviors.length; i++){
+ behaviors.add(new SelectItem(sizeExceededBehaviors[i], sizeExceededBehaviors[i]));
+ }
}
public String addQueue(){
@@ -85,4 +96,12 @@
public void setTimeout(int timeout) {
this.timeout = timeout;
}
+
+ public ArrayList<SelectItem> getBehaviors() {
+ return behaviors;
+ }
+
+ public void setBehaviors(ArrayList<SelectItem> behaviors) {
+ this.behaviors = behaviors;
+ }
}
Modified: trunk/test-applications/jsp/src/main/webapp/CustomizePage/CustomizePage.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/CustomizePage/CustomizePage.jsp 2008-11-28
13:24:40 UTC (rev 11431)
+++ trunk/test-applications/jsp/src/main/webapp/CustomizePage/CustomizePage.jsp 2008-11-28
13:30:10 UTC (rev 11432)
@@ -9,31 +9,22 @@
<head>
</head>
<body>
- <rich:separator lineType="solid" height="1" />
- <table width="400">
- <tbody>
- <tr>
- <td onmouseover="updateName('Alex')"
onmouseout="updateName('')">
- Alex</td>
- <td onmouseover="updateName('Jonh')"
onmouseout="updateName('')">
- Jonh</td>
- <td onmouseover="updateName('Roger')"
onmouseout="updateName('')">
- Roger</td>
- </tr>
- <tr>
- <td colspan="3"><h:outputText id="showname"
- value="Name: #{userBean.name}" /></td>
- </tr>
- </tbody>
- </table>
+ <h:form>
+ <a4j:queue />
+ <a4j:queue />
+ <h:commandButton action="#" value="submit" />
+ <h:panelGrid columns="2">
+ <h:outputLabel for="a4jLodID"
value="a4j:log"></h:outputLabel>
+ <h:selectBooleanCheckbox id="a4jLodID" value="#{option.log}"
+ onchange="submit();"></h:selectBooleanCheckbox>
- <a4j:form>
- <a4j:jsFunction id="updateName" name="updateName"
reRender="showname">
- <a4j:actionparam name="param1" assignTo="#{userBean.name}"
/>
- </a4j:jsFunction>
- </a4j:form>
-
- <rich:separator height="1" style="padding-top:10px" />
+ <a4j:status id="a4jStatusID" startText="WORK!"
+ startStyle="color: red;"
stopText="a4j:status"></a4j:status>
+ </h:panelGrid>
+ <rich:calendar requestDelay="500" ignoreDupResponses="true"
+ ajaxSingle="true" mode="ajax"></rich:calendar>
+ </h:form>
+ <h:form><a4j:log popup="false"
rendered="#{option.log}"></a4j:log></h:form>
</body>
</f:view>
</html>
Modified: trunk/test-applications/jsp/src/main/webapp/Queue/Queue.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Queue/Queue.jsp 2008-11-28 13:24:40 UTC
(rev 11431)
+++ trunk/test-applications/jsp/src/main/webapp/Queue/Queue.jsp 2008-11-28 13:30:10 UTC
(rev 11432)
@@ -3,7 +3,7 @@
<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
-<f:subview id="queueSubviewID">
+<f:subview id="queueSubviewID">
<a4j:queue binding="#{queue.myQueue}"
disabled="#{queue.disabled}"
ignoreDupResponses="#{queue.ignoreDupResponses}"
@@ -11,9 +11,8 @@
onbeforedomupdate="#{event.onbeforedomupdate}"
oncomplete="#{event.oncomplete}"
onerror="#{event.onerror}"
- onsizeexceeded="#{event.onsizeexceeded}"
- onsubmit="#{event.onsubmit}"
- rendered="#{queue.rendered}"
+ onsizeexceeded="alert('onsizeexceeded');"
+ onsubmit="#{event.onsubmit}"
requestDelay="#{queue.requestDelay}"
size="#{queue.size}"
sizeExceededBehavior="#{queue.sizeExceededBehavior}"
Modified: trunk/test-applications/jsp/src/main/webapp/Queue/QueueProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Queue/QueueProperty.jsp 2008-11-28
13:24:40 UTC (rev 11431)
+++ trunk/test-applications/jsp/src/main/webapp/Queue/QueueProperty.jsp 2008-11-28
13:30:10 UTC (rev 11432)
@@ -4,37 +4,34 @@
<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
<f:subview id="queuePropertySubviewID">
- <h:commandButton value="add test"
- action="#{queue.addQueue}"></h:commandButton>
+ <h:commandButton value="add test"
action="#{queue.addQueue}"></h:commandButton>
<h:panelGrid columns="2">
<h:outputText value="disabled" />
<h:selectBooleanCheckbox value="#{queue.disabled}"
onclick="submit()" />
<h:outputText value="ignoreDupResponses" />
<h:selectBooleanCheckbox value="#{queue.ignoreDupResponses}"
- onclick="submit()" />
+ onclick="submit()" />
- <h:outputText value="rendered" />
- <h:selectBooleanCheckbox value="#{queue.rendered}"
onclick="submit()" />
-
<h:outputText value="requestDelay" />
<h:inputText value="#{queue.requestDelay}">
- <a4j:support event="onchange"
reRender="queueID"></a4j:support>
+ <a4j:support event="onchange"
reRender="formID"></a4j:support>
</h:inputText>
<h:outputText value="size" />
<h:inputText value="#{queue.size}">
- <a4j:support event="onchange"
reRender="queueID"></a4j:support>
+ <a4j:support event="onchange"
reRender="formID"></a4j:support>
</h:inputText>
- <h:outputText value="requestDelay" />
- <h:panelGroup>
- <h:inputText value="#{queue.sizeExceededBehavior}"
- id="sizeExceededBehaviorID">
- <a4j:support event="onchange"
reRender="queueID"></a4j:support>
- </h:inputText>
- <h:outputLabel value=" \"dropNext\", \"dropNew\",
\"fireNext\", \"fireNew\"" for="sizeExceededBehaviorID"
/>
- </h:panelGroup>
+ <h:outputText value="sizeExceededBehavior" />
+ <h:selectOneRadio value="#{queue.sizeExceededBehavior}"
onchange="submit();">
+ <f:selectItems value="#{queue.behaviors}" />
+ </h:selectOneRadio>
+ <h:outputText value="timeout" />
+ <h:inputText value="#{queue.timeout}" id="timeoutID">
+ <a4j:support event="onchange"
reRender="formID"></a4j:support>
+ </h:inputText>
+
</h:panelGrid>
</f:subview>
\ No newline at end of file
Modified: trunk/test-applications/jsp/src/main/webapp/Queue/QueueStraightforward.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Queue/QueueStraightforward.jsp 2008-11-28
13:24:40 UTC (rev 11431)
+++ trunk/test-applications/jsp/src/main/webapp/Queue/QueueStraightforward.jsp 2008-11-28
13:30:10 UTC (rev 11432)
@@ -12,7 +12,7 @@
<h:outputText value="h:inputText" />
<h:inputText value="#{queueComponent.inputValue}"
id="inputID">
- <a4j:support id="inputSupport" event="onblur"
+ <a4j:support id="inputSupport" event="onkeyup"
eventsQueue="#{queueComponent.inputQueue}"></a4j:support>
</h:inputText>
@@ -23,7 +23,7 @@
<h:outputText value="rich:calendar" />
<rich:calendar id="calendarID"
value="#{queueComponent.calendarValue}"
- eventsQueue="#{queueComponent.calendarQueue}">
+ mode="ajax" reRender="panelID"
eventsQueue="#{queueComponent.calendarQueue}">
</rich:calendar>
<h:selectOneMenu value="#{queueComponent.calendarQueue}"
Modified: trunk/test-applications/jsp/src/main/webapp/pages/Rich/Rich.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/pages/Rich/Rich.jsp 2008-11-28 13:24:40
UTC (rev 11431)
+++ trunk/test-applications/jsp/src/main/webapp/pages/Rich/Rich.jsp 2008-11-28 13:30:10
UTC (rev 11432)
@@ -26,7 +26,7 @@
<link rel="stylesheet"
href="<%=request.getContextPath()%>/styles/styles.css"
type="text/css"/>
</head>
<body>
- <a4j:queue name="org.richfaces.global_queue"
disabled="false"/>
+ <a4j:queue name="org.richfaces.global_queue"
disabled="false"/>
<a4j:queue name="namedQueue"/>
<a4j:queue />
<h:form id="formID">