<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: page.isActive doesn't update after calling setPage in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/page-isActive-doesn-t-update-after-calling-setPage/m-p/334010#M9889</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/7815"&gt;@teroman&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you try using &lt;A href="https://microsoft.github.io/PowerBI-JavaScript/classes/_src_page_.page.html#setactive" target="_self"&gt;setActive()&lt;/A&gt;&amp;nbsp;which m&lt;SPAN&gt;akes the current page the active page of the report to see if it works in your scenario?&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.fabric.microsoft.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;page.setActive();&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jan 2018 09:49:34 GMT</pubDate>
    <dc:creator>v-ljerr-msft</dc:creator>
    <dc:date>2018-01-08T09:49:34Z</dc:date>
    <item>
      <title>page.isActive doesn't update after calling setPage</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/page-isActive-doesn-t-update-after-calling-setPage/m-p/333111#M9858</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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 pages again using getPages(), so I'd expect to get the current values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code sample is below, it's very simple so I don't think I'm doing anything wrong (but I might well be!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help apreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Colin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var pageCodeName = "..." //name from somewhere, it is valid
var report = powerbi.embed(...);
&lt;BR /&gt;//button calls this
function setThePage(){

//this sets the active page, I can see it switch correctly
report.setPage(pageCodeName);

//some time later, ask which page is active
window.setTimeout(function(){
        report.getPages().then(function(pages){
            for(var i=0; i&amp;lt;pages.length; i++){
                if(pages[i].isActive){ &lt;BR /&gt;                    //this alerts the original page name, not the currently active one
                    alert(pages[i].displayName);
                }
            }
        });
    }, 10000);

}&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Jan 2018 11:06:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/page-isActive-doesn-t-update-after-calling-setPage/m-p/333111#M9858</guid>
      <dc:creator>teroman</dc:creator>
      <dc:date>2018-01-05T11:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: page.isActive doesn't update after calling setPage</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/page-isActive-doesn-t-update-after-calling-setPage/m-p/334010#M9889</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/7815"&gt;@teroman&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you try using &lt;A href="https://microsoft.github.io/PowerBI-JavaScript/classes/_src_page_.page.html#setactive" target="_self"&gt;setActive()&lt;/A&gt;&amp;nbsp;which m&lt;SPAN&gt;akes the current page the active page of the report to see if it works in your scenario?&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.fabric.microsoft.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;page.setActive();&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 09:49:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/page-isActive-doesn-t-update-after-calling-setPage/m-p/334010#M9889</guid>
      <dc:creator>v-ljerr-msft</dc:creator>
      <dc:date>2018-01-08T09:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: page.isActive doesn't update after calling setPage</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/page-isActive-doesn-t-update-after-calling-setPage/m-p/334042#M9892</link>
      <description>&lt;P&gt;Nope, that doens't work either, Page1 still has isActive = true. &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://community.fabric.microsoft.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;New code to switch pages:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    report.getPages().then(function(pages){
        var reqdPage = null;
        for(var i=0; i&amp;lt;pages.length; i++){
            if(pages[i].name)===pageName){
                reqdPage = pages[i];
                break;
            }
        }
        
        if(reqdPage){
            return reqdPage.setActive();
        }
    });&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 10:23:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/page-isActive-doesn-t-update-after-calling-setPage/m-p/334042#M9892</guid>
      <dc:creator>teroman</dc:creator>
      <dc:date>2018-01-08T10:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: page.isActive doesn't update after calling setPage</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/page-isActive-doesn-t-update-after-calling-setPage/m-p/338189#M10005</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/7815"&gt;@teroman&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this scenario, I would suggest you create a new issue on &lt;A href="https://github.com/Microsoft/PowerBI-JavaScript/issues" target="_self"&gt;Microsoft/PowerBI-JavaScript Issues&lt;/A&gt;&amp;nbsp;for better assistance.&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.fabric.microsoft.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2018 07:41:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/page-isActive-doesn-t-update-after-calling-setPage/m-p/338189#M10005</guid>
      <dc:creator>v-ljerr-msft</dc:creator>
      <dc:date>2018-01-15T07:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: page.isActive doesn't update after calling setPage</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/page-isActive-doesn-t-update-after-calling-setPage/m-p/3936370#M52734</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Please mark this post resolved&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Resolution: (&lt;SPAN&gt;with the latest features in version 3.1.0 as of July 2023)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;To set the input page as active&lt;/P&gt;&lt;P&gt;set_active_page(page_name)&lt;BR /&gt;Arguments:&lt;/P&gt;&lt;P&gt;page_name (string): name of the page you want to set as active&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Usage:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;report.set_active_page(page_name)&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 15:57:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/page-isActive-doesn-t-update-after-calling-setPage/m-p/3936370#M52734</guid>
      <dc:creator>Jiny</dc:creator>
      <dc:date>2024-05-21T15:57:45Z</dc:date>
    </item>
  </channel>
</rss>

