-
15. Re: how to fire an event on completion of another event
liuliu Jun 5, 2009 4:25 AM (in response to ashutoshdeora)
a4j:push maybe a solution. -
16. Re: how to fire an event on completion of another event
ashutoshdeora Jun 5, 2009 4:57 AM (in response to ashutoshdeora)liuliu,
a4j:push is not the solution
please see this post
Posted: Thu Jun 4, 2009 07:55 AM Post subject: Re: how to fire an event on completion of another event
i have tried a4j:push
it does not fit in the scene
please suggest some thing else -
17. Re: how to fire an event on completion of another event
nbelaevski Jun 5, 2009 5:19 AM (in response to ashutoshdeora)You need to use JavaScript to initiate the second request - no another suitable alternative if push is not an options. Good news: there's a special a4j:jsFunction component that makes initiating AJAX request from JS very easy.
-
18. Re: how to fire an event on completion of another event
ashutoshdeora Jun 5, 2009 5:36 AM (in response to ashutoshdeora)have 2 database query
Code: METHOD A(){ QUERY 1 - it will fetch small amount of data - i put this data in rich:datatable (TABLE 1) }
Code: METHOD B(){ QUERY 2 - it will fetch huge amount of data (it will take some time to do it) i will put this data also in rich:datatable (TABLE 1) }
i have only one click to perform this
condition:- i can click only once
i have to complete method A then return to the page (i have to move out of backing bean where result will be displayed after display is completele only then i can execute METHOD B
i cannot call method B in Method A
NBELAEVSKI this is my actual requirement
and i posted this earlier also
bacisally METHOD A will provide data in nutshell which will be posted in the screen for user to read
then METHOD 2 will provide the detail data which will then be updated on to the page
and user will click button only once that to in starting
after this he will not perform any action
i think now i am very clear about my requirement -
19. Re: how to fire an event on completion of another event
nbelaevski Jun 5, 2009 5:54 AM (in response to ashutoshdeora)"ashutoshdeora" wrote:
NBELAEVSKI this is my actual requirement
and i posted this earlier also
I'd say "no way". -
20. Re: how to fire an event on completion of another event
ashutoshdeora Jun 5, 2009 5:58 AM (in response to ashutoshdeora)NBELAEVSKI,
ok then i have to think of something else and have to drop this requirement
thanks for the time
and ideas -
21. Re: how to fire an event on completion of another event
panky_p Jun 5, 2009 6:35 AM (in response to ashutoshdeora)ashutoshdeora
If you need it any how as I told you there is no clean way to do this, I can suggest one thing use javascript.
On the button which is calling METHOD A call javascript on oncomplete of first action, put one hidden button and that button should call your METHOD B, and in javascript perform click on hidden button.
Something likeclickHidden(){ document.getElementById("hiddenButtonId").click(); } <a4j:commandButton action="METHOD A" oncomplete="clickHidden();"/> <a4j:commandButton id="hiddenButton" style="display:none;" action="METHOD B"/>
But as I told you I think it's not clean approach. -
22. Re: how to fire an event on completion of another event
liuliu Jun 5, 2009 6:42 AM (in response to ashutoshdeora)
i have something similar than yours.
start method a, start method b in a thread at the end of method a, when methode b ends, trigger event of a4j:push, and then a4j:push refresh the page.
what do you think? -
23. Re: how to fire an event on completion of another event
ashutoshdeora Jun 8, 2009 12:19 AM (in response to ashutoshdeora)panky_p,
thanks for the suggestion
it is working very very well
it was really a solution to my problem
thanks once again -
24. Re: how to fire an event on completion of another event
panky_p Jun 8, 2009 2:39 AM (in response to ashutoshdeora)Most welcome ... :)
-
25. Re: how to fire an event on completion of another event
nbelaevski Jun 8, 2009 5:46 AM (in response to ashutoshdeora)"panky_p" wrote:
ashutoshdeora
If you need it any how as I told you there is no clean way to do this, I can suggest one thing use javascript.
On the button which is calling METHOD A call javascript on oncomplete of first action, put one hidden button and that button should call your METHOD B, and in javascript perform click on hidden button.
Something likeclickHidden(){ document.getElementById("hiddenButtonId").click(); } <a4j:commandButton action="METHOD A" oncomplete="clickHidden();"/> <a4j:commandButton id="hiddenButton" style="display:none;" action="METHOD B"/>
But as I told you I think it's not clean approach.
No hidden button is necessary if you use a4j:jsFunction. -
26. Re: how to fire an event on completion of another event
ashutoshdeora Jun 8, 2009 5:57 AM (in response to ashutoshdeora)nbelaevsk,
can u write me a small example taking this one as examlpe
clickHidden(){ document.getElementById("hiddenButtonId").click(); } <a4j:commandButton action="METHOD A" oncomplete="clickHidden();"/> <a4j:commandButton id="hiddenButton" style="display:none;" action="METHOD B"/>
i tried but didnt get it
please help in this -
27. Re: how to fire an event on completion of another event
panky_p Jun 8, 2009 5:59 AM (in response to ashutoshdeora)nick
you are right, I know a4j:jsFunction will work and if you read the post from start you will notice, I already suggest the same. -
28. Re: how to fire an event on completion of another event
ashutoshdeora Jun 8, 2009 6:02 AM (in response to ashutoshdeora)can u please write me the
a4j:jsfunction
for the example u suggested me
it should perform the same -
29. Re: how to fire an event on completion of another event
ashutoshdeora Jun 8, 2009 6:02 AM (in response to ashutoshdeora)clickHidden(){ document.getElementById("hiddenButtonId").click(); } <a4j:commandButton action="METHOD A" oncomplete="clickHidden();"/> <a4j:commandButton id="hiddenButton" style="display:none;" action="METHOD B"/>
in this