为什么我的预览窗口不显示FormElement内容

时间:2015-06-25 12:02:39

标签: javascript sapui5

我正在尝试将sap.ui.layout.form.Form FormContainerFormElements添加到预览Dialog。但是,我的表格及其元素不会被渲染 Click Here

{
  "Type": "sap.ui.core.mvc.JSONView",
  "content": [
    {
      "Type": "sap.m.Button",
      "id": "testitemid0",
      "text": "MyTestButton",
      "press": "asdf"
    },
    {
      "Type": "sap.ui.layout.form.Form",
      "id": "testitemid1",
      "formContainers": [
        {
          "Type": "sap.ui.layout.form.FormContainer",
          "id": "testitemid2",
          "formElements": [
            {
              "Type": "sap.ui.layout.form.FormElement",
              "id": "testitemid3",
              "label": {
                "Type": "sap.m.Label",
                "id": "testitemid4",
                "text": "My Test Label"
              },
              "fields": [
                {
                  "Type": "sap.m.Input",
                  "id": "testitemid5",
                  "value": "My Test Input",
                  "placeholder": ""
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

任何想法,为什么它不呈现表单?

1 个答案:

答案 0 :(得分:0)

我的sap.ui.layout.form.Form-Element只是缺少布局:

{
  "Type": "sap.ui.layout.form.Form",
  "id": "testitemid1",
  "layout": {
      "Type": "sap.ui.layout.form.GridLayout"
  },
  ...
}

JSBin