This content has been marked as final. 
    
Show                 3 replies
    
- 
        1. Re: sequence execution not followed in seam reemotingshane.bryzak Feb 1, 2007 4:24 PM (in response to surajmundada)Remoting calls are asynchronous. You need to put any code that you want synchronized into the callback method. 
- 
        2. Re: sequence execution not followed in seam reemotingsurajmundada Feb 2, 2007 3:16 AM (in response to surajmundada)Thanks for the reply. 
 I tried to write a callback method but could not catch the return string.
 My listener method looks like :@WebRemote public String resetPage() { logger.info(helper.formatLogMessage("Resetting the page")); if(searchDrugtUI != null) { searchDrugtUI.setFamily(""); searchDrugtUI.setNameTypAnt(""); searchDrugtUI.setWhoCode(""); drugPEList = null; } return "success"; }
 Javascript looks like :function fun_resetPage() { alert('in fun_resetPage'); Seam.Component.getInstance("searchListener").resetPage(resetPageCallback); } function resetPageCallback(result) { alert(result); if(result == 'success') { fun_openSearchWindow(); } } function fun_openSearchWindow(){ Seam.Remoting.setDebug(true); Seam.Component.getInstance("searchListener").resetPage(); //alert('in fun_openSearchWindow()'); window.open('search.jsf','search','scrollbars,height=400,width=700'); }
 I have enabled debug mode and can see the "success" string in response packet. But control does not come to "resetPageCallback()" method.
 Is there any thing wrong with "....("searchListener").resetPage(resetPageCallback);" ???
 I am not sure if I can put optional parameter "resetPageCallback" in method call to "resetPage()" when I have no compulsary paratmeter to pass.
 Regards,
 Suraj
- 
        3. Re: sequence execution not followed in seam reemotingshane.bryzak Feb 2, 2007 8:39 AM (in response to surajmundada)Hmm... it should work. Can you try putting your callback method before the code that references it? I.e: function resetPageCallback(result) { alert(result); if(result == 'success') { fun_openSearchWindow(); } } function fun_resetPage() { alert('in fun_resetPage'); Seam.Component.getInstance("searchListener").resetPage(resetPageCallback); } function fun_openSearchWindow(){ Seam.Remoting.setDebug(true); Seam.Component.getInstance("searchListener").resetPage(); //alert('in fun_openSearchWindow()'); window.open('search.jsf','search','scrollbars,height=400,width=700'); }
 
    