Hi, I'm new to Alfresco Activiti.
I've already desgin a flow on activiti-app with a simple form.
In the form, there are a textbox id named "cal", a dropdown field id named "quantity" and amount field named "amount".
What I want to do is use javascript to do auto calculation when value is changed on the form.
I found there is a javascript tab and there are lots events I could use.
In my case, "formFieldValueChanged" may be useful,
but I don't know how I can get the value from "cal", "quantity" and "amount"?
Could anyone help to give some sample code to let me know how to do this?
In addition, any reference url that I could know more detail on the params of "scope", "form", "field"?
I have read this guide actually Alfresco Activiti, but it seems not mentioned anymore.
Any feedbacks are appreciated and thanks!
BR,
Mandy
Solved! Go to Solution.
Hi Mandy,
Based on your most recent inquiry I believe you have found the "helper" function, but as a matter of documentation here it is again:
scope.findFormFieldWithId(scope.allFormFields, 'quantity')
This will get you a JSON object and depending on the type of field it is you can retrieve the value, id or name.
Cheers,
Greg
bp3
Hi Mandy,
Based on your most recent inquiry I believe you have found the "helper" function, but as a matter of documentation here it is again:
scope.findFormFieldWithId(scope.allFormFields, 'quantity')
This will get you a JSON object and depending on the type of field it is you can retrieve the value, id or name.
Cheers,
Greg
bp3
Many thanks for your kindly feedback.
I found it just by google, but it seems there are lack of information on google.
I wonder to know what is the "helper" function?
May I know where I could find it? thanks!
BR,
Mandy
Unfortunately nothing is documented. I had to find all this by crawling through the source.
There are a few "Helper" functions defined in render-form.js
1. setItemVisibility - runs the visibility logic for the form
2. findFormFieldWithId - locates a specific form field within a collection
3. prepareFormFields - populate data into typeahead, table, dropdown etc from defined REST calls.
Im sure there are others, but since none are documented, it is hard to know what is going to change in the future so have to be careful what you use.
Greg
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.