Hi,
I’ve implemented Cascading dropdown list in Camunda embedded form, see sample code. From the example, the form values are in JSON format.
How do I store selected form input value (
Hi,
I’ve implemented Cascading dropdown list in Camunda embedded form, see sample code. From the example, the form values are in JSON format.
How do I store selected form input value (
Hi,
I already solved my issue by adding Spin dependency and some code below,
pom.xml
<dependency>
<groupId>org.camunda.bpm</groupId>
<artifactId>camunda-engine-plugin-spin</artifactId>
<version>${camunda.spin.version}</version>
</dependency>
<dependency>
<groupId>org.camunda.spin</groupId>
<artifactId>camunda-spin-dataformat-json-jackson</artifactId>
<version>${camunda-spin-dataformat-json-jackson.version}</version>
</dependency>
Define form variable
<script cam-script type="text/form-script">
var division = $scope.division = {};
camForm.variableManager.createVariable({
name: 'division',
type: 'json',
value: division
});
camForm.on('submit', function() {
$scope.division = camForm.variableManager.variableValue('division', $scope.division);
});
and change the form element as below,
<select id="DIVISION" class="form-control" required ng-model="division" ng-options="division as division.DivisionName for division in divisions">
<option value="" disabled>Select</option>
</select>
Then I can fetch form variable later in the next form