3

I need to make an Ajax call inside OFBiz framework using prototype.js. I am doing that from a .ftl file. I am confused about how to handle the server side - through Java event or Java service? What is the best practice? And also I am having problems making the framework recognize the 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 none on the combination of prototype + OFBiz. If anybody has done anything in OFBiz like this, please help.

1 Answer 1

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.