on 07-22-2015 1:29 PM
View.xml
<core:View xmlns:core="sap.ui.core"
controllerName="newinitiative.NewInitiative3" xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="sap.suite.ui.commons">
<HarveyBallMicroChart size="M" total="100" totalScale="Mrd" showTotal="true" showFractions="true" press="press" >
<items>
<HarveyBallMicroChartItem fraction="63.5" color="Good" valueScale="Mrd" />
</items>
</HarveyBallMicroChart>
</core:View>
this is my output screen .i want to add back button in this to navigate back to previous view.
thanks and regards,
Abhishek lohiya
So, what have you tried?
I don't see you're using a Page (which can include the navButton in its header). If you have implemented routing, you can use that button to navigate back
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
like below,
<core:View xmlns:core="sap.ui.core"
controllerName="newinitiative.NewInitiative3" xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="sap.suite.ui.commons">
<Page showNavButton="true" navButtonPress="onBack">
<HarveyBallMicroChart size="M" total="100" totalScale="Mrd" showTotal="true" showFractions="true" press="press" >
<items>
<HarveyBallMicroChartItem fraction="63.5" color="Good" valueScale="Mrd" />
</items>
</HarveyBallMicroChart>
</Page>
</core:View>
so onBack method you can write your go back logic.
Hi Santhosh ,
I tried this but getting error.
Failed to load resource: the server responded with a status of 404 (Resource could not be found!)send @ sap-ui-core.js:27
sap-ui-core.js:144 Uncaught Error: failed to load 'sap/suite/ui/commons/Page.js' from resources/sap/suite/ui/commons/Page.js: 404 - Resource could not be found!
http://localhost:53467/favicon.ico Failed to load resource: the server responded with a status of 404 (Not Found)
regards,
Abhishek lohiya
Hi Abhishek,
Since the Page belongs to Mobile Library, what you need to to do is to add a namespace in core like this
<core:View xmlns:core="sap.ui.core"
controllerName="newinitiative.NewInitiative3" xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="sap.suite.ui.commons" xmlns:m="sap.m">
And then use page like this
<m:Page showHeader=true showNavButton=true>
try this,
<core:View xmlns:core="sap.ui.core"
controllerName="newinitiative.NewInitiative3" xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="sap.suite.ui.commons" xmlns:m="sap.m">
<m:Page showNavButton="true" navButtonPress="onBack">
<HarveyBallMicroChart size="M" total="100" totalScale="Mrd" showTotal="true" showFractions="true" press="press" >
<items>
<HarveyBallMicroChartItem fraction="63.5" color="Good" valueScale="Mrd" />
</items>
</HarveyBallMicroChart>
</m:Page>
</core:View>
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.