Использую RichFaces 3 и JSF 1.
Столкнулся с такой проблемой. При множественных запросов ajax на одной jsf странице, ответы приходят с в неправильном порядке. Т.е. посылаю первый запрос - в ответ ничего, потом второй - получаю ответ на первый. Попробовал упорядочить запросы с помощью параметра eventsQueue="foo" не помогло, тогда попробовал использовать пару параметров вместе ajaxSingle="true" process="email" - не помогло. Попробовал и то и другое вместе :-) - результат тот же.
Может кто-нибудь уже решал такую проблему при множественном использовании тега a4j:support.
Вот кусок моего кода с уже всякими неработающими накрутками
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
template="../layout/template.xhtml">
<ui:define name="body">
<h1>Завершение звонка.</h1>
<rich:panel>
<h:panelGrid columns="2">
<h:graphicImage value="/img/seamlogo.png" alt="Seam logo" style="top:0px;"/>
<s:div styleClass="info">
<p><strong>Результат звонка</strong> </p>
<a4j:outputPanel ajaxRendered="true">
<h:form id="_endOfCallForm">
<ul class="bullets">
<h:panelGrid columns="2">
<h:selectOneRadio value="#{person.callResultInfo.callResult}" layout="pageDirection">
<f:selectItem itemValue="unreachable" itemLabel="Недозвон"/>
<f:selectItem itemValue="fax" itemLabel="Автоответчик/факс"/>
<f:selectItem itemValue="wrongNumber" itemLabel="Неверный номер"/>
<f:selectItem itemValue="recall" itemLabel="Перезвонить"/>
<f:selectItem itemValue="denial" itemLabel="Отказ (нет информации)"/>
<a4j:support event="onchange" ajaxSingle="true" process="_denyPanel,_button,_calendar" eventsQueue="foo" reRender="_denyPanel,_button,_calendar" action="#{person.callResultInfo.resetDenial()}"/>
<!--onclick="document.getElementById('_endOfCallForm:_denyPanel').style.backgroundColor='#c8dcf9'"/-->
</h:selectOneRadio>
<h:panelGrid id="_calendar" columns="1">
<a4j:outputPanel layout="block" rendered="#{(person.callResultInfo.callResult == 'recall')}" ajaxRendered="true">
<rich:calendar value="#{person.callResultInfo.recallDate}"
locale="#{backBean.locale}"
popup="true"
datePattern="dd.MM.yyyy HH:mm"
showApplyButton="true"
isDayEnabled="disablementFunction"
dayStyleClass="disabledClassesProv"
cellWidth="24px" cellHeight="22px" style="width:200px"/>
</a4j:outputPanel>
</h:panelGrid>
</h:panelGrid>
<br/>
<h:panelGrid id="_denyPanel" columns="2">
<a4j:outputPanel id="_denialPanel" ajaxRendered="true" rendered="#{(person.callResultInfo.callResult == 'denial')}">
<p><strong>Причина отказа</strong> </p>
<h:selectOneRadio id="_denialCause" value="#{person.callResultInfo.callDeny}" layout="pageDirection">
<f:selectItem itemValue="denyToTalk" itemLabel="Отказ от разговора"/>
<f:selectItem itemValue="denyToInform" itemLabel="Отказ от предоставления информации"/>
<f:selectItem itemValue="deth" itemLabel="Абонент умер/местонахождение неизвестно"/>
<f:selectItem itemValue="callBack" itemLabel="Позвонит сам"/>
<f:selectItem itemValue="dontWantMTT" itemLabel="Не пользуется/не хочет пользоваться МТТ"/>
<f:selectItem itemValue="wasCalled" itemLabel="Утверждает, что уже звонили"/>
<f:selectItem itemValue="unfriendly" itemLabel="Негативно настроенный абонент"/>
<f:selectItem itemValue="other" itemLabel="Другое (указать в комментарии)"/>
<a4j:support event="onchange" ajaxSingle="true" process="_commentar,_button,_phone" eventsQueue="foo" reRender="_commentar,_button,_phone" />
</h:selectOneRadio>
</a4j:outputPanel>
<h:panelGrid columns="1" id="_phone">
<a4j:outputPanel ajaxRendered="true" rendered="#{person.callResultInfo.callDeny == 'callBack'}">
<rich:panel>
<h:outputText value="Наш телефон для обратной связи:"></h:outputText>
<br/>
<h:outputText value="8 800 333 53 58" style="font:bold;"></h:outputText>
</rich:panel>
</a4j:outputPanel>
</h:panelGrid>
<a4j:outputPanel id="_commentar">
<a4j:outputPanel ajaxRendered="true" rendered="#{(person.callResultInfo.callDeny == 'other')}">
<p><strong>Комментарий</strong> </p>
<h:inputTextarea value="#{person.callResultInfo.callDenyCommentar}">
<a4j:support event="onkeyup" ajaxSingle="true" process="_button" eventsQueue="foo" reRender="_button"/>
</h:inputTextarea>
</a4j:outputPanel>
</a4j:outputPanel>
</h:panelGrid>
</ul>
<h:panelGrid id="_button" columns="1">
<h:commandButton type="submit" value="Далее" action="#{backBean.submitEndOfCall()}"
disabled="#{(empty person.callResultInfo.callResult) or (((person.callResultInfo.callResult == 'denial') and (empty person.callResultInfo.callDeny)) or ((person.callResultInfo.callDeny == 'other') and (empty person.callResultInfo.callDenyCommentar)))}">
<!--rich:componentControl id="_mpControl" for="_modalPanel" operation="show"
event="onclick" rendered="#{person.callResultInfo.callDeny == 'callBack'}"/-->
</h:commandButton>
</h:panelGrid>
</h:form>
</a4j:outputPanel>
</s:div>
</h:panelGrid>
</rich:panel>
<h:panelGrid columns="1" id="_mpId">
<a4j:outputPanel rendered="#{person.callResultInfo.callDeny == 'callBack'}">
<rich:modalPanel id="_modalPanel" width="350" height="100">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="Телефон обратной связи"></h:outputText>
</h:panelGroup>
</f:facet>
<f:facet name="controls">
<h:panelGroup>
<h:graphicImage value="../img/close.png" styleClass="hidelink" id="_hidelinkId"/>
<rich:componentControl for="_modalPanel" attachTo="_hidelinkId" operation="hide" event="onclick"/>
</h:panelGroup>
</f:facet>
<h:outputText value="Наш телефон для обратной связи:"></h:outputText>
<br/>
<h:outputText value="8 800 333 53 58" style="font:bold;"></h:outputText>
</rich:modalPanel>
</a4j:outputPanel>
</h:panelGrid>
</ui:define>
</ui:composition>