[英]sapui5 fiori xml view how to add the BulletChart
i am coding in fiori (sap web ide) and i have a lack of understanding:我在 fiori (sap web ide) 中编码,但我缺乏理解:
<mvc:View
xmlns="sap.m"
xmlns:core="sap.ui.core"
xmlns:mvc="sap.ui.core.mvc"
xmlns:l="sap.ui.layout"
xmlns:f="sap.ui.layout.form" controllerName="test.view.Detail">
<Page id="detailPage" navButtonPress="onNavBack" title="{i18n>detailTitle}" showNavButton="{device>/isPhone}">
<content>
<ObjectHeader id="detailHeader" title="{SelectedOption}" introActive="false" titleActive="false" iconActive="false">
<customData id="customData3">
<core:CustomData id="coreCustomData3" key="sapDtResourcePath" value="ClaimingHeader"></core:CustomData>
</customData>
<attributes id="detailAttributes">
<ObjectAttribute id="attribute" text="{i18n>detailText}" active="false"></ObjectAttribute>
</attributes>
<firstStatus id="detailStatus">
<ObjectStatus id="status" text="{SelectedOption}">
<customData id="customData4">
<core:CustomData id="coreCustomData4" key="sapDtResourcePath" value="ClaimingHeader"></core:CustomData>
</customData>
</ObjectStatus>
</firstStatus>
</ObjectHeader>
<IconTabBar id="idIconTabBar" expanded="{device>/isNoPhone}">
<customData id="customData5">
<core:CustomData id="coreCustomData5" key="sapDtResourcePath" value="ClaimingHeader"></core:CustomData>
</customData>
<items id="detailsItems">
<IconTabFilter id="iconTabFilter1" key="selfInfo" icon="sap-icon://calendar">
<content>
<f:SimpleForm id="iconTabFilter1form" minWidth="1024" editable="false" layout="ResponsiveGridLayout" labelSpanL="3" labelSpanM="3" emptySpanL="4" emptySpanM="4" columnsL="1">
<f:content>
at the bottom of the code, i want to include this sample code from sapui5 sdk: Code: Bullet Micro Chart在代码的底部,我想包含来自 sapui5 sdk 的示例代码: 代码:子弹微图
the problem is, that the code of the BulletChart starts with问题是 BulletChart 的代码以
<core:View controllerName="sap.suite.ui.commons.sample.BulletChart.BulletChart" xmlns="sap.suite.ui.commons" xmlns:core="sap.ui.core">
my problem is, that it doesnt work, if i add this core:View.. inside of mvc:View.. and/or its the other controller, controllerName="sap.suite.ui.commons.sample.BulletChart.BulletChart, which in want to put inside mvc:view , where there is already a controller.我的问题是,它不起作用,如果我在 mvc:View.. 和/或它的另一个控制器中添加这个 core:View..想要放在 mvc:view 里面,那里已经有一个控制器。
can someone help me and explain me, how to put this BulletChart at this place?有人可以帮我解释一下,如何把这个 BulletChart 放在这个地方?
thanks for help!感谢帮助! Screenshot on Imageshack what i want to do @ the link below.
我想在 Imagehack 上做的截图@下面的链接。
Screenshot on Imageshack what i want to do Imagehack 上的屏幕截图我想做什么
You have to do the way described below:您必须按照下面描述的方式进行操作:
Add xmlns:commons="sap.suite.ui.commons" to your XML将xmlns:commons="sap.suite.ui.commons" 添加到您的 XML
<mvc:View
xmlns="sap.m"
xmlns:core="sap.ui.core"
xmlns:mvc="sap.ui.core.mvc"
xmlns:l="sap.ui.layout"
xmlns:f="sap.ui.layout.form"
xmlns:commons="sap.suite.ui.commons"
controllerName="test.view.Detail">
then add inside the page content: Notice that we need to have proper namespace depending on xmlns declaration然后在页面内容中添加:请注意,我们需要根据xmlns声明具有适当的命名空间
<commons:BulletChart size="XS" scale="M" targetValue="100" forecastValue="110" class="marginTopLeft" press="press">
<commons:actual>
<commons:BulletChartData value="120" color="Good"/>
</commons:actual>
<commons:thresholds>
<commons:BulletChartData value="0" color="Error"/>
<commons:BulletChartData value="50" color="Critical"/>
<commons:BulletChartData value="150" color="Critical"/>
<commons:BulletChartData value="200" color="Error"/>
</commons:thresholds>
</commons:BulletChart>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.