如何在项目模板中添加IconTabSeparator?

2020-09-05 17:23发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)我有一个带有json视图的sap...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


我有一个带有json视图的sapui5应用。 下面是json视图的代码

json视图如下所示

"节":[
   {
     " id":" idMenuButtonSection",
     " subSections":[
       {
         "主要":[
           {
             " Type":" sap.m.IconTabBar",
             " headerMode":"内联",
             " headerBackgroundDesign":" {widgetModel>/headerBackgroundDesign}",
             "项目":[
               {
                 " path":" widgetModel>/filters",
                 "模板":{
                   " Type":" sap.m.IconTabFilter",
                   " showAll":" {widgetModel> showAll}",
                   " enabled":" {widgetModel> enabled}",
                   " text":" {widgetModel> text}",
                   " icon":" {widgetModel> icon}",
                   " iconColor":" {widgetModel> color}",
                   " count":" {widgetModel> count}",
                   "内容":[
                     {
                       " Type":" sap.m.Button",
                       " text":" {widgetModel> text}"
                     }
                   ]
                 }
               }
             ]
           }
         ]
       }
     ]
   }
 ] 

数据绑定如下

" widgetModel":{" headerBackgroundDesign":"透明","过滤器":[{" text":"发布"," count":" 9"," showAll":true},{" text":  "初始时间","颜色":"默认","启用":true,"计数":1," icon":" sap-icon://appointment-2"},{" text":"选项1  "," color":"默认"," count":" 2"," enabled":是," icon":" sap-icon://appointment-2"},{" text":"选项2"  ," count":" 3"," color":"正"," enabled":是," icon":" sap-icon://appointment-2"},{" text":"选项3",  " count":" 3"," color":"默认"," enabled":假," icon":" sap-icon://appointment-2"}]} 
,输出类似于附件中的。 现在,我想添加IconTabSeparator。 如何在过滤器中添加它?
 

(12.4 kB)
8条回答
clever101
2020-09-05 17:57

你好桑托什,希望你一切都好。

尝试通过添加与IconTabBar项的类型相对应的字段来调整小部件模型。 例如:字段"类型",如下所示:

" widgetModel":{
 " headerBackgroundDesign":"透明",
 "过滤器":[{
                 " type":" sap.m.IconTabFilter",
 " text":"发布",
 " count":" 9",
 " showAll":true
 },{
                 " type":" sap.m.IconTabSeparator"
 },{
                 " type":" sap.m.IconTabFilter",
 " text":"初始时期",
 " color":"默认",
 "已启用":是,
 "计数":1
 " icon":" sap-icon://appointment-2"
 },{
                 " type":" sap.m.IconTabFilter",
 " text":"选项1",
 " color":"默认",
 " count":" 2",
 "已启用":是,
 " icon":" sap-icon://appointment-2"
 },{
 " text":" Option 2",
                 " type":" sap.m.IconTabFilter",
 " count":" 3",
 " color":"正",
 "已启用":是,
 " icon":" sap-icon://appointment-2"
 },{
 " text":" Option 3",
 " count":" 3",
 " color":"默认",
 "已启用":false,
 " icon":" sap-icon://appointment-2"
 }]
 } 

在JSON视图一侧,修改IconTabBar模板的属性"类型"以正确接收新的模型属性。

 ...
 "模板":{
 " Type":" {widgetModel> type}",
 " showAll":" {widgetModel> showAll}",
 " enabled":" {widgetModel> enabled}",
 " text":" {widgetModel> text}",
 " icon":" {widgetModel> icon}",
 " iconColor":" {widgetModel> color}",
 " count":" {widgetModel> count}",
 "内容":[{
 " Type":" sap.m.Button",
 " text":" {widgetModel> text}"
 }]
 }
 ... 

KR,
Arthur Silva

一周热门 更多>