How to dynamically populate data in form upon change


#1

Hi

How can I populate data in an embedded form upon change. For example, I enter customer ID, and upon “ng-blur” or “ng-change” a call is made to the backend to fetch the customer name and fill the text box accordingly.

There is no event in camForm that helps with this, so I have no idea how to communicate with the backend WHILE inputting data. Appreciate any help!


#2

I think I can partially reply to myself by saying probably I need to look at calling the REST api. More specifically, it could be something like

inject([’$http’, ‘Uri’, function($http, Uri) {
// $http.get(Uri.appUri('engine://engine/:engine/blahblah …
});

I’m not sure if I’m on the right track, but I suspect this is a place to start from at least.


#3

Upon further analysis I’m still stuck. Here is why:

  • My data is not in the standard task tables, it’s my own domain objects, so REST cannot handle it
  • The form I’m controlling is the start form, So I cannot loop in the BPMN diagram back to the start form.

Damn I did not expect this to be so damn hard. I just need dynamic data like auto-complete or DB query upon javascript event. This is proving to be exceptionally hard!


#4

After lots and lots of research, I realized the ultimate solution is to develop my own REST API: I will attempt to do this with JAX-RS without leaving the embedded forms, and then simply firing AJAX requests. I hope this makes it work, and I’m documenting it here for anyone to benefit from it.


#5

Can you please share the sample how you called REST_API from Usertask / forms