1 Reply Latest reply on Jan 23, 2014 8:23 PM by laura.whellans

    Implementing DWR in Jive 5

    laura.whellans

      Hi,

       

      I am just wondering what the process is with implementing a new Java class and its methods using DWR so that I can access the methods directly in my FTLs in a plugin?

       

      I have added a new bean to my spring.xml, and included the DWR namespaces - my project builds fine - but when I attempt to load / access this in my ftl - I get a ReferenceError Examplet Bean not defined.

       

      My spring.xml file looks like this (please note - my environment is offline so I have hand typed this in - I don't believe there are any syntax errors because I build with no errors - any syntax errors below are probably from me mistyping into here):

       

      <bean id="myTestExample" class="myproject.testexample.beans.MyTestExample">
           <dwr:remote javascript="ExampleBean"/>
      </bean>
      
      <dwr:configurations>
           <dwr:create type="new" javascript="ExampleBean" class="myproject.testexample.beans.MyTestExample">
                <dwr:include method="getHelloWorld"/>
           </dwr:create>
      </dwr:configurations>
      

       

       

      My ftl - where I call on this is as follows:

       

      <@resource.dwr file="ExampleBean">
      
      <script>
      $j(document).ready(function() {
      
           ExampleBean.getHelloWorld({
                callback:function(msg) {
                     alert(msg);
                }
           });
      });
      </script>
      

       

       

       

       

      Am I missing something somewhere?

       

      Any help appreciated.

       

      Cheers,

      Laura