【问题标题】:How to populate camunda html form Select from Json如何填充camunda html表单从Json中选择
【发布时间】: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 和它的值 -

关于如何从我的 json myData 中填充我的 html 表单的任何帮助 谢谢

    标签: camunda


    【解决方案1】:

    你解决了这个问题吗?我也有同样的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-24
      • 1970-01-01
      • 2015-10-06
      • 1970-01-01
      • 2019-05-15
      相关资源
      最近更新 更多