Forum Discussion
teroman
8 years agoFrequent Visitor
page.isActive doesn't update after calling setPage
Hi all, I'm embedding a Power BI report and have a button that will set the active page. Later I query the active page, but the original page is still set as active. Note that I do fetch the page...
v-ljerr-msft
8 years agoMicrosoft Employee
Hi teroman,
Could you try using setActive() which makes the current page the active page of the report to see if it works in your scenario? :smileyhappy:
page.setActive();
Regards
- teroman8 years agoFrequent Visitor
Nope, that doens't work either, Page1 still has isActive = true. :smileysad:
If I show the nav pane and switch pages by clicking then the isActive property doesn't change either. Seems not to work at all for me.
New code to switch pages:
report.getPages().then(function(pages){ var reqdPage = null; for(var i=0; i<pages.length; i++){ if(pages[i].name)===pageName){ reqdPage = pages[i]; break; } } if(reqdPage){ return reqdPage.setActive(); } });- v-ljerr-msft8 years agoMicrosoft Employee
Hi teroman,
In this scenario, I would suggest you create a new issue on Microsoft/PowerBI-JavaScript Issues for better assistance. :smileyhappy:
Regards