-
1. Re: execution order a4j:support and a4j:commandbutton
nimo22 Mar 3, 2010 3:50 AM (in response to ajanz)hello,
try:
<a4j:support event="oncomplete"
-
2. Re: execution order a4j:support and a4j:commandbutton
ajanz Mar 3, 2010 4:58 AM (in response to nimo22)why oncomplete?
i got onblur as event
would using requestdelay a solution to order the requests?
-
3. Re: execution order a4j:support and a4j:commandbutton
ilya_shaikovsky Mar 3, 2010 5:08 AM (in response to ajanz)<h:form id="myform"> <a4j:queue/> <h:panelGrid columns="2"> <h:inputText id="myinput" value="#{userBean.name}"> <a4j:support event="onblur" reRender="outtext" action="#{userBean.action1}" similarityGroupingId="formblur" requestDelay="100"/> </h:inputText> <a4j:commandButton action="#{userBean.action2}" value="submit" similarityGroupingId="formblur" requestDelay="100"/> </h:panelGrid> </h:form>
work for me firing only action2.
But I must admit that
action of the button is first executed and then the a4j:support which leads to an error.
not occured from the beginning for me. support action waas called first using the test.
-
4. Re: execution order a4j:support and a4j:commandbutton
ilya_shaikovsky Mar 3, 2010 5:32 AM (in response to nimo22)Re: execution order a4j:support and a4j:commandbuttonhello,
try:
<a4j:support event="oncomplete"
I'm not sure how this could solve the problem.
-
5. Re: execution order a4j:support and a4j:commandbutton
ajanz Mar 3, 2010 5:50 AM (in response to ilya_shaikovsky)no, i want first action1 executed, then action2
important is to stay in the textbox and the directly clicking the button, then the excution order is action2 action1
-
6. Re: execution order a4j:support and a4j:commandbutton
nimo22 Mar 3, 2010 9:29 AM (in response to ajanz)Try this:
{code:xml}
<a4j:commandLink value="fire action in chronologically order" action="#{myBean.fireAction_1}">
<a4j:support event="oncomplete" action="#{myBean.fireAction_2}"/>
</a4j:commandLink>{code:xml}
So when I click the button, then "fireAction_1" is triggered, after this action is excecuted, then (via 'oncomplete') "fireAction_2" is excecuted.
I know, Ilya had said to me: (http://community.jboss.org/thread/148611)
{quote}
At first - do not use support in a4j:command* and the other components
on events which causes ajax requests. This causes two requests to be sent.
In your case - one from button and the second from support.
Button itself is enough to rise ajax call.
{quote}
But for my cases, it works. 'myBean.fireAction_2' is invoked AFTER 'myBean.fireAction_1'.
Hope it helps a litte.
-
7. Re: execution order a4j:support and a4j:commandbutton
ilya_shaikovsky Mar 3, 2010 9:56 AM (in response to ajanz)no, i want first action1 executed, then action2
I checked and have this result using my code in any browser. (removed similarity)
-
8. Re: execution order a4j:support and a4j:commandbutton
ajanz Mar 3, 2010 10:02 AM (in response to nimo22)hm but what about the action fired from onblur from the h:inputtext? -
9. Re: execution order a4j:support and a4j:commandbutton
ilya_shaikovsky Mar 3, 2010 10:30 AM (in response to ajanz)staying in input and clicking the button I see action from blur executed and action from button executed in next request -
10. Re: execution order a4j:support and a4j:commandbutton
ajanz Mar 3, 2010 5:33 PM (in response to ilya_shaikovsky)hups. that's quite interesting.
where's a difference?
i am using ie8 and requestdealy="0"
-
11. Re: execution order a4j:support and a4j:commandbutton
ilya_shaikovsky Mar 4, 2010 2:12 AM (in response to ajanz)<h:form id="myform"> <a4j:queue/> <h:panelGrid columns="2"> <h:inputText id="myinput" value="#{userBean.name}"> <a4j:support event="onblur" reRender="outtext" action="#{userBean.action1}"/> </h:inputText> <a4j:commandButton action="#{userBean.action2}" value="submit"/> </h:panelGrid> </h:form>
Here is the last code I've used. Checked under IE8 FF 3.6