Symptom
- Apply Application.setActivePage in Chart.onSelect.
- After page is switched, you will need to click on '<' twice on the toolbar to go to previous page.
Environment
SAP Analytics Cloud
Reproducing the Issue
- Click on Table in Page1, it goes to Page2, click on "<" to go back Page1, succeeded.
- Click on Chart in Page1, it goes to Page2, click on "<" to go back Page1, failed.
- On second click "<" on Page 2, succeeded.
Cause
The .onSelect event of the Chart widget is triggered every time a selection changes, including when a selection is cleared.
When switching back to the previous page, the selection of the chart is cleared due to the page switch. This triggers the .onSelect event of the chart again, resulting in a return to the same page.
Resolution
To resolve this issue, add a condition to check if the selection is empty or not. Use the following script:
if (this.getSelections().length > 0) { Application.setActivePage(Page_2);}
In this way, the page switch only occurs if there is an active selection.
See Also
- 2569847 - Where can you find SAC user assistance (help) to use, configure, and operate it more effectively?
- Have a question? Ask it here and let our amazing SAP community help! Or reply and share your knowledge!
- 2487011 - What information do I need to provide when opening a case for SAP Analytics Cloud?
- Search for SAP Analytics Cloud content using Google or Bing:
- https://www.google.ca/search?q=site%3Ahttps%3A%2F%2Fapps.support.sap.com+SAP+Analytics+Cloud
- https://www.bing.com/search?q=site%3Ahttps%3A%2F%2Fapps.support.sap.com+SAP+Analytics+Cloud
- Note: Add relevant text or warning/error messages to the text search field to filter results.
- SAP Analytics Cloud > Learning > Data Connections
- SAP Analytics Cloud > Learning > Guided Playlists
- SAP Analytics Cloud > Learning > Guided Playlists > Getting Support
- Need More Help? Contact Support or visit the solution finder today!
Your feedback is important to help us improve our knowledge base.
Keywords
SAP Analytics Cloud, Page Navigation, onSelect Event, Chart Widget, Script, Selection Change, Active Selection. , KBA , LOD-ANA-UNS-SCR , Unified Story Scripting related Issues , Problem