views:

582

answers:

1

I need to make an Ajax call inside OFBiz framework using prototype.js. I am doing that from a ftl file. I am confused of how to handle the server side - through java event or java service. What is the best practice? And also i am having problem making the framework recognize prototype.js file. There is some issue with the path name in the script tag. It has to be some peculiar naming as per OFBiz framework standards.

I searched google but I only found links on how to use prototype but no where prototype + OFBiz. If anybody has done anything in OFBiz like this, please help.

Thanks, Kaushik

A: 

The server process the ajax request just like any other request. It may contain an event or not, and the response your js function will get is the HTML output ( if the response is a view ). If you want to use JSON, you must create an event with type="jsonservice" ( and you must include the jsonservice handler in your controller file ). This way you can send and receive data structures using ajax.

Ismael