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

    Implementing DWR in Jive 5




      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"/>
           <dwr:create type="new" javascript="ExampleBean" class="myproject.testexample.beans.MyTestExample">
                <dwr:include method="getHelloWorld"/>



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


      <@resource.dwr file="ExampleBean">
      $j(document).ready(function() {
                callback:function(msg) {





      Am I missing something somewhere?


      Any help appreciated.




        • Re: Implementing DWR in Jive 5

          I worked it out.


          when including the dwr bean - IT MUST BE PLACED INBETWEEN the <head> tags - this may mean that it will sit within another ftl file.

          <@resource.dwr file="ExampleBean">  



          THEN - you can call on the methods from within your script tags to your hearts content.


          hope this helps someone