4 Replies Latest reply on Jul 28, 2009 6:05 PM by Tim Morgan

    Web Remote: Annotated method has no JS stub.

    Tim Morgan Newbie

      Hi!
      I have a problem using web remote.


      My goal is to have a button which is supposed to open a browser window but only if a bean member has a specific value.
      To achieve this I would like to use web remoting. I call a javascript method which makes a call via web remote and decides if it is allowed to open depending on the return value.


      I annotated the method on the interface, added the seam-remoting.jar but I do not get a javascript stub for the annotated method.


      I even tried it with the sayHello() example but I have the same effect.


      My code:


      The interface:


      @Local
      public interface GalleryManagerLocal extends AssetManagerLocal {
              @WebRemote
              public String sayHello(String name);
      
              // some other methods
      }



      The session bean:



      @Stateful
      @Name("galleryManager")
      public class GalleryManager extends AssetManager implements GalleryManagerLocal {
      
              @WebRemote // tried with or without
              public String sayHello(String name) {
                      return ("\"Hello World\" von " + name);
              }
      
              // some other methods
      }



      The generated interface.js?galleryManager:


      Seam.Remoting.type.galleryManager = function() {
        this.__callback = new Object();
      }
      Seam.Remoting.type.galleryManager.__name = "galleryManager";
      
      Seam.Component.register(Seam.Remoting.type.galleryManager)



      Calling


      function sayHello() {
              var name = prompt("Name");
              Seam.Component.getInstance("galleryManager").sayHello(name, sayHelloCallback);
      }
      



      alway leads to Seam.Component.getInstance(galleryManager).sayHello is not a function


      What can I do to get the annotated methods beeing included in the interface.js?
      It seems like the annotation is not read.


      Thanks!


      Michael