0

I'm a newbie of DWR World and I have some problems to understand the right behaviour of my application.

I have this situation:

File dwr.xml

<dwr>
  <allow>
    <create creator="new" javascript="Starred">
      <param name="class" value="it.mypackage.entity.Starred" />
    </create>
    <convert converter="bean" match="it.mypackage.beans.ActivityBean"/>
  </allow>
</dwr>

Within my html page I have:

<% String name = "myname"; %>
<li><input type="checkbox" name="a" class="styled" /><a href="#" onclick="Products.addProducts(name, 1,myjs)">Monitor</a></li>

and in my Products.java I have:

public void addProducts(String name, String id) {
  System.out.println(name + "_" + id);
}

but when I click on this checkbox nothing happears. If I change String name with integer value System.out works correctly.

Can you help me please?

CeccoCQ
  • 3,746
  • 12
  • 50
  • 81

1 Answers1

1

You will need to add in your dwr.xml

<create creator="new" javascript="Product">
<param name="class" value="fully qualified name of your Product class" />
<include method="addProducts" />

Then in your JSP, you will need to include the following java script files.

engine.js

util.js

interface/Product.js

ajm
  • 12,863
  • 58
  • 163
  • 234
  • I have a question; The paths given in the JSP file for the JS ..Are they just virtual and not physically existing...eg.g... – copenndthagen Apr 19 '11 at 12:26
  • @hmthur The files will be created by DWR at run time. If you save the source code of the page from the browser you will see those files in the HTML supporting files. – ajm Apr 19 '11 at 12:45