1 2 Previous Next 16 Replies Latest reply on Dec 24, 2008 5:49 PM by alin.heyoulin.qq.com

    Remoting Callback

    srpantano

      I made a remote test and the call to class method it's fine, but the callback method is never called in page, why?


      My class:


      @Name("configuratorAction")
      @Scope(ScopeType.CONVERSATION)
      public class ConfiguratorAction { // extends EntityController {
          @WebRemote
          public String getRemoteModule(String module) {
              return "aaa";
          }
      }



      and my page:



      <script type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/seam/resource/remoting/resource/remote.js"></script>    
      <script type="text/javascript">
           //<![CDATA[
           jQuery.noConflict(); //Retira os conflitos com o Richfaces            
                  
           jQuery(window).bind("load",function(){
                  
               jQuery("input.buttonModule").click( function() {
                   changeModule();
               });
                  
           });
                  
           function changeModule() {
                      
               var jqModule = jQuery("select.modules").val();
               var confComponent = Seam.Component.getInstance("configuratorAction");
                      
               confComponent.getRemoteModule(jqModule, remoteModuleCallback);
                      
           }
                  
           function remoteModuleCallback(result) {
                alert("Hi!");                
           }
           // ]]>
      </script>





        1 2 Previous Next