cancel
Showing results for 
Search instead for 
Did you mean: 

how to add back button in harveyballmicro chart??

former_member187188
Participant
0 Kudos

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 

Accepted Solutions (1)

Accepted Solutions (1)

Qualiture
Active Contributor
0 Kudos

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

santhu_gowdaz
Active Contributor
0 Kudos

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.

former_member187188
Participant
0 Kudos

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

aswani_sanjay
Explorer
0 Kudos

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>

santhu_gowdaz
Active Contributor
0 Kudos

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>

former_member187188
Participant
0 Kudos

thanks now its working

regards,

Abhishek lohiya

former_member187188
Participant
0 Kudos

Thanks sanjay now its working .

regards,

Abhishek lohiya

Answers (0)