Hi, thanks for the question.
It is not clear what the Camunda is doing here. If you need to generate new interface elements, then using JS it is done like this: <script> var articleDiv = document.querySelector("div.article"); var elem = document.createElement("h2"); var elemText = document.createTextNode("Hello, world!!!"); elem.appendChild(elemText); articleDiv.appendChild(elem); </script>
If you want to read some variables from the backend to the front-end, then this code will do it (adapt it to your own conditions):
<script cam-script type="text/form-script"> var variableManager = camForm.variableManager;
I did speak somewhat superficially at first. Here is a simple example of dynamic widget generation that is fully compatible with the Camunda. The forum does not allow you to upload a file *.html separately, so copy this code to “test.html” and test it.
<script type="text/javascript">
var countInput = 1;
function addser()
{
//Defining the element where we will place widgets
var form = document.getElementById('dinamic');
//Generating (so far programmatically) widgets that will be added to the form
var checkB = document.createElement("input");
var br = document.createElement("br");
//We set the parameters we need for each widget
checkB.id = "checkbox_" + countInput;
checkB.type = "checkbox";
//I recommend this format for recording parameters, because it will add absolutely any tag
checkB.setAttribute("any_tag", "any_value");
//Adding widgets to the form
form.appendChild(checkB);
form.appendChild(br);
countInput++;
}
</script>
<form role="form" name="form">
<div class="control-group">
<input type="button" id = "usadd" onclick="addser()" value = "Add widget">
<div id = "dinamic"></div>
</div>
</form>