-
1. Re: Problems using ajax validation in seam-gen
damianharvey Aug 17, 2007 12:32 PM (in response to vincent.latombe)The ajax4jsf forum http://www.jboss.com/index.html?module=bb&op=viewforum&f=259 is a better place for this but post your a:support tag so we can see the attributes that you are using. bypassUpdates="true" is probably a good candidate for you depending on what you are trying to do.
Cheers,
Damian -
2. Re: Problems using ajax validation in seam-gen
vincent.latombe Aug 20, 2007 4:27 AM (in response to vincent.latombe)my a:support looks like this
<a:support event="onblur" bypassUpdates="true" reRender="nomDecoration"/>
I get the problem on base Seam-gen application. Just edit some field and submit without any click outside of the field before. You should get the message. -
3. Re: Problems using ajax validation in seam-gen
damianharvey Aug 20, 2007 6:44 AM (in response to vincent.latombe)I see what you mean. I get this as well and mine are set to event="onchange".
-
4. Re: Problems using ajax validation in seam-gen
pmuir Aug 20, 2007 10:59 AM (in response to vincent.latombe)Please file a JIRA issue for this.
-
5. Re: Problems using ajax validation in seam-gen
vincent.latombe Aug 21, 2007 5:33 AM (in response to vincent.latombe)Issue added : http://jira.jboss.com/jira/browse/JBSEAM-1832
-
6. Re: Problems using ajax validation in seam-gen
damianharvey Aug 31, 2007 10:26 AM (in response to vincent.latombe)As mentioned in the JIRA this is the code (added to any old page) that will cause ajax4jsf to reset the conversation resulting in a "The conversation ended, timed out or was processing another request" error.
I realise that this sort of problem is better suited to the ajax4jsf forum but wanted to keep continuity with JIRA.
Bean:@Name("calcBean") public class CalcBean { private Integer first = new Integer(0); private Integer second = new Integer(0); private Integer third = new Integer(0); public Integer getFirst() { return first; } public void setFirst(Integer first) { this.first = first; } public Integer getSecond() { return second; } public void setSecond(Integer second) { this.second = second; } public Integer getThird() { return third; } public void setThird(Integer third) { this.third = third; } public Integer getTotal() { return this.first + this.second + this.third; } }
Page (put these on any page):<s:decorate id="firstDecoration" template="layout/edit.xhtml"> <ui:define name="label">First</ui:define> <h:inputText id="first" required="true" value="#{personHome.first}"> <a:support event="onblur" reRender="firstDecoration, total" eventsQueue="calc" ignoreDupResponses="true"/> </h:inputText> </s:decorate> <s:decorate id="secondDecoration" template="layout/edit.xhtml"> <ui:define name="label">Second</ui:define> <h:inputText id="second" required="true" value="#{personHome.second}"> <a:support event="onblur" reRender="secondDecoration, total" eventsQueue="calc" ignoreDupResponses="true"/> </h:inputText> </s:decorate> <s:decorate id="thirdDecoration" template="layout/edit.xhtml"> <ui:define name="label">Third</ui:define> <h:inputText id="third" required="true" value="#{personHome.third}"> <a:support event="onblur" reRender="thirdDecoration, total" eventsQueue="calc" ignoreDupResponses="true"/> </h:inputText> </s:decorate> <s:div id="total"> Total: <h:outputText value="#{personHome.total}"/> </s:div>
Enter some values in the first, second and third and then tab over them and back again. Ajax4JSF will be overwhelmed and will kill the page (or at least generate the error mentioned above).
Regards,
Damian. -
7. Re: Problems using ajax validation in seam-gen
pmuir Aug 31, 2007 1:07 PM (in response to vincent.latombe)I still can't reproduce this.
I made the getTotal() method this:public Integer getTotal() { for (int i = 0; i < 100000000; i++) { int j = i / 10 + 10; } log.info("printing total"); return this.first + this.second + this.third; }
to simulate very heavy load inside the getTotal method, entered some values and sat there with my finger on tab for a while. I get this printed out:18:04:12,993 INFO [CalcBean] printing total 18:04:13,630 INFO [CalcBean] printing total 18:04:26,813 INFO [CalcBean] printing total 18:04:29,843 INFO [CalcBean] printing total 18:04:30,448 INFO [CalcBean] printing total 18:04:31,257 INFO [CalcBean] printing total 18:04:31,319 INFO [CalcBean] printing total 18:04:31,826 INFO [CalcBean] printing total 18:04:31,846 INFO [CalcBean] printing total 18:04:31,909 INFO [CalcBean] printing total 18:04:31,940 INFO [CalcBean] printing total 18:04:31,982 INFO [CalcBean] printing total 18:04:31,984 INFO [CalcBean] printing total 18:04:32,108 INFO [CalcBean] printing total 18:04:32,175 INFO [CalcBean] printing total 18:04:32,246 INFO [CalcBean] printing total 18:04:32,434 INFO [CalcBean] printing total 18:04:32,545 INFO [CalcBean] printing total 18:04:32,566 INFO [CalcBean] printing total 18:04:32,602 INFO [CalcBean] printing total 18:04:32,613 INFO [CalcBean] printing total 18:04:32,619 INFO [CalcBean] printing total 18:04:34,024 INFO [CalcBean] printing total 18:04:34,062 INFO [CalcBean] printing total
So, as you can see the function does take a non-trivial amount of time to process but a4j/seam does handle the load. What version of ajax4jsf? I'm using the one in Seam CVS (1.1.1) -
8. Re: Problems using ajax validation in seam-gen
tim_ph Aug 31, 2007 3:29 PM (in response to vincent.latombe)is there a <rich:panel> or any panel that these <a:support> are inside? It can make a difference as other post had mentioned.
-
9. Re: Problems using ajax validation in seam-gen
damianharvey Aug 31, 2007 4:41 PM (in response to vincent.latombe)Pete,
Can you please post your XHTML?
I'm using a very recent Seam nightly build (jboss-seam-CVS.2007-08-30_14-35-23) which has ajax4jsf1.1.1
Cheers,
Damian. -
10. Re: Problems using ajax validation in seam-gen
pmuir Aug 31, 2007 5:25 PM (in response to vincent.latombe)<!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:rich="http://richfaces.ajax4jsf.org/rich" xmlns:a="https://ajax4jsf.dev.java.net/ajax" template="layout/template.xhtml"> <ui:define name="body"> <h:messages globalOnly="true" styleClass="message"/> <h:form> <s:decorate id="firstDecoration" template="layout/edit.xhtml"> <ui:define name="label">First</ui:define> <h:inputText id="first" required="true" value="#{calcBean.first}"> <a:support event="onblur" reRender="firstDecoration, total" eventsQueue="calc" ignoreDupResponses="true"/> </h:inputText> </s:decorate> <s:decorate id="secondDecoration" template="layout/edit.xhtml"> <ui:define name="label">Second</ui:define> <h:inputText id="second" required="true" value="#{calcBean.second}"> <a:support event="onblur" reRender="secondDecoration, total" eventsQueue="calc" ignoreDupResponses="true"/> </h:inputText> </s:decorate> <s:decorate id="thirdDecoration" template="layout/edit.xhtml"> <ui:define name="label">Third</ui:define> <h:inputText id="third" required="true" value="#{calcBean.third}"> <a:support event="onblur" reRender="thirdDecoration, total" eventsQueue="calc" ignoreDupResponses="true"/> </h:inputText> </s:decorate> <s:div id="total"> Total: <h:outputText value="#{calcBean.total}"/> </s:div> </h:form> </ui:define> </ui:composition>
As index.xhtml in seam-gen project. -
11. Re: Problems using ajax validation in seam-gen
damianharvey Aug 31, 2007 6:45 PM (in response to vincent.latombe)Pete,
Add a page.xml with a <begin-conversation join="true"/>. 100% failure rate. Or at least it is for me.
I used your for loop and it doesn't even make it past 2 tab stops. If I take out the conversation it handles it fine.
Cheers,
Damian. -
12. Re: Problems using ajax validation in seam-gen
vincent.latombe Sep 1, 2007 5:31 AM (in response to vincent.latombe)I get the same result as Damian. There must be something wrong inside the handling of conversation
-
13. Re: Problems using ajax validation in seam-gen
vincent.latombe Sep 1, 2007 5:57 AM (in response to vincent.latombe)The problem seems to lie in org.jboss.seam.core.Manager, method restoreAndLockConversation.
The first call locks the conversation, the next ones can't lock it and are redirected to an error. Conversation should allow concurrent access, or at least wait for unlock instead of going to error handling -
14. Re: Problems using ajax validation in seam-gen
vincent.latombe Sep 1, 2007 6:06 AM (in response to vincent.latombe)In ConversationEntry :
I tried to replacereturn lock.tryLock( Manager.instance().getConcurrentRequestTimeout(), TimeUnit.MILLISECONDS );
withlock.lock(); return true;
Which replacing the failing lock with a waiting lock. With the example from above with the loop, the flooding seems to work also it makes the page a little dizzy (because all calls to getTotal get executed serially). But in normal operation it works perfectly.