我正在尝试使用cds视图创建一个附加到odata服务的smartform . 我能够使用注释和metadata.xml成功创建smartfilter和table,但我在smartform中陷入困境 . 视图使用智能域渲染得很好,但问题是我必须为每个智能域定义entitySet,而在示例应用程序中我检查这不是必需的 . 如果我从智能域中删除实体集,则不会渲染智能域 . 以下是我遵循的步骤顺序

Step1:我导入了odata服务并创建了一个默认模型 .

第二步:根据数据服务创建本地注释文件,如下所示:

<Annotations Target="ZCustomService.ZCustomServiceType"> <Annotation 
     Term="Common.SemanticKey"> <Collection> 
     <PropertyPath>abc</PropertyPath> </Collection> </Annotation> 
     </Annotations>

在元数据中,相同属性存在如下:

<Property Name="abc" Type="Edm.String" MaxLength="4" sap:display- 
   format="UpperCase" sap:creatable="true" sap:updatable="true" 
   sap:label="Purchase Order"/>

在我看来,我使用smartform如下:

<sap.ui.comp.smartform:SmartForm 
  xmlns:sap.ui.comp.smartform="sap.ui.comp.smartform" 
  xmlns:sap.ui.comp.smartfield="sap.ui.comp.smartfield" id="__form1"> 
  <sap.ui.comp.smartform:groups> <sap.ui.comp.smartform:Group label="Group 
  title" title="Group title" id="__group0"> 
  <sap.ui.comp.smartform:groupElements> <sap.ui.comp.smartform:GroupElement 
  id="__element0"> <sap.ui.comp.smartform:elements> 
  <sap.ui.comp.smartfield:SmartField id="__field0" value="{abc}" entitySet 
  ="ZCustomService"/> </sap.ui.comp.smartform:elements> 
  </sap.ui.comp.smartform:GroupElement> 
  </sap.ui.comp.smartform:groupElements> </sap.ui.comp.smartform:Group> 
  </sap.ui.comp.smartform:groups> </sap.ui.comp.smartform:SmartForm>

在这里请求您的专家建议..

我还浏览了SCN上发布的博客,但我没有看到这些选项

https://blogs.sap.com/2016/04/22/how-to-use-smart-templates-with-sap-web-ide-extensibility/

https://blogs.sap.com/2017/06/06/dynamic-field-control-using-annotations-in-sapui5/