web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Navigation API in PCF ...
Power Apps
Unanswered

Navigation API in PCF control doesn't open web resource in a same browser tab

(0) ShareShare
ReportReport
Posted on by 6
Hi Devs,
 
I am trying to open a web resource in the main Power model driven Apps tab on an image click inside a PCF dataset control. The image is wrapped in anchor tag having onclick event handler. I have set the openInNewWindow option to false and tried setting height and width elements to 0 in an openWebresourceOptions parameter of context.navigation.openWebResource method, but still it gets opened in a new tab.
 
Everytime it opens it in a new tab or window, however I need to open it in the main power model driven apps window.
 
Here you go with the method that runs on the click of an anchor and opens the web resource.
 
    // Method to open the web resource
    private openWebResource(context: ComponentFramework.Context<IInputs>): void {
        // https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/navigation/openwebresource
 
        // Web Resource name`
        const webResourceName = "new.html";
        // OpenWebResourceOptions
        const openWebresourceOptions = { openInNewWindow: false };
        // Open the web resource using context.navigation.openWebResource
        context.navigation.openWebResource(webResourceName, openWebresourceOptions);
    }
 
 
I have the same question (0)
  • Verified answer
    SaiRT14 Profile Picture
    1,990 Super User 2025 Season 2 on at
     
    Opening a web resource directly in the main tab of a model-driven app using context.navigation.openWebResource may not work as expected due to platform constraints. Using Web Resource Controls, Custom Pages, or a Modal Dialog is a more reliable approach to display the resource within the app. The recommended method is to transition to Custom Pages for modern, seamless integration.
     
    If embedding isn’t required, you can use a modal dialog to display the web resource instead of opening it in a new tab: Use navigateTo with Modal Dialog: context.navigation.navigateTo({
      pageType: "webresource",
      webresourceName: "new.html",
    }, {
      target: 2, // Opens in a modal dialog
      height: { value: 70, unit: "%" },
      width: { value: 50, unit: "%" },
    });
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard