1 2 Previous Next 16 Replies Latest reply on Jan 3, 2017 2:43 AM by jjagadeesh1215

    Seam.Component.getInstance raise Seam is not defined

    shanghanyu
      Hi,
         Im doing remoting for js and trying to get the example from the doc to work. Have configured servlet in the web.xml, put
      <script type="text/javascript" src="seam/resource/remoting/resource/remote.js"></script>
      <s:remote include="helloAction"/>
      <script type="text/javascript">
        //<![CDATA[
        function sayHello() {
          var name = prompt("What is your name?");
          Seam.Component.getInstance("helloAction").sayHello(name, sayHelloCallback);
        }
        function sayHelloCallback(result) {
          alert(result);
        }
         // ]]>
      </script>
      in the body of a xhtml
      and created the class and the interface as told in the doc
      but Im getting no response but this using firebug when entering the name in the prompt box and hit OK:

      Seam.Component.getInstance("helloAction").sayHello is not a function
      [Break On This Error] Seam.Component.getInstance("helloAction").sayHello(name, sayHelloCallback);

      Can anybody give a hint on this, thx.

        1 2 Previous Next