Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8507

Re: How to get data from a second page?

$
0
0

Hi Aaron,


 

you can use the EventBus for the same.

 

1) publish the event bus on click of the button ( the event f which navigates back to the earlier page)

2) in the publish of this event bus, pass all the data which you have captured / which has been clicked.

3) subscribe the eventBus in the App.Controller page ( assuming that you have created an app.view in which you have defined the sap.m.App() , to take care of all the pages to be added into the app).

4) the handler function of this subscribe, will navigate you to the page required, along with the whole set of data you have passed in the publish of event bus.

5) use onBeforeShow(oEvent) hook method in the view, which is being finally routed to.

 

all the data passed from the previous view will be accessible here via : oEvent.data.dataPassedFromPreviousView

 

Note : dataPassedFromPreviousView, assuming is to be the object in which u have set the data in the publish.

 


Hope it helps.



 

Regards,

Viren Gupta


Viewing all articles
Browse latest Browse all 8507

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>