【发布时间】:2022-08-05 17:49:57
【问题描述】:
我正在尝试从我的外部服务客户端发送的json 填充 camunda html 表单选择。
这是我发送的 json -
{myData=[{\"id\":1,\"name\":\"This is one\",\"value\":\"value11\",\"localName\":\"this is local name 11\"},{\"id\":2,\"name\":\"This is Two\",\"value\":\"value22\",\"localName\":\"this is local name 22\"}]}
这是我的html表单-
<form>
<div>
<select
cam-variable-type=\"String\"
cam-variable-name=\"selected_option\"
ng-options=\"item as item.name for item in myData track by item.id\"
ng-model=\"selected\"
class=\"form-control\">
</select>
</div>
<script cam-script type=\"text/form-script\">
camForm.on(\'form-loaded\', function() {
// tell the form SDK to fetch the variable named \'myData\'
camForm.variableManager.fetchVariable(\'myData\');
});
camForm.on(\'variables-fetched\', function() {
// work with the variable (bind it to the current AngularJS $scope)
$scope.myData = camForm.variableManager.variableValue(\'myData\');
});
</script>
</form>
关于如何从我的 json myData 中填充我的 html 表单的任何帮助 谢谢
标签: camunda