0 Replies Latest reply on Mar 5, 2009 4:23 AM by zwz mycoy

    Problem of using ajax with jseam remoting

    zwz mycoy Newbie

      Hi,everyone:
          I'm, studying ajax in jseam with remoting, but got stuck with a little demo.
           The java code:
      @Local
      public interface HelloLocal {
        @WebRemote
        public String sayHello(String name);
      }


      @Stateless
      @Name(helloAction)
      public class HelloAction implements HelloLocal {
        public String sayHello(String name) {
          return  name;
        }
      }



           The xhtml page:
        <script type="text/javascript"
                              src="seam/resource/remoting/resource/remote.js"></script>
                      <s:remote include="helloAction" />

                      <script type="text/javascript">
         
              function sayHello() {
                var name = 'zwz';
                Seam.Component.getInstance("helloAction").sayHello(name, sayHelloCallback);
              }
             
              function sayHelloCallback(result) {
                alert(result);
              }
                      </script>

                      <button onclick="javascript:sayHello()">
                              Say Hello
                      </button>



          But when deployed and ran, it always warn javascript error "Seam method not defined", and there's no exception.
          In fact the demo is copy from jseam examples.
          I use jseam2.1.1 , JBoss AS 5.0 , ie7.
          Could anyone help me?
          Or if anyone has some runnable simple demo, could please send me a copy? zw_z7@hotmail.com
          Thanks very much.