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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

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,992 Super User 2025 Season 1 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 413

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
timl Profile Picture

timl 315 Super User 2026 Season 1

Last 30 days Overall leaderboard