function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Syed Hussain RazaSyed Hussain Raza 

How to link a lightning web component page to a button in another lightning web component page?

Hey guys so i have read a lot about the force navigation on the internet but here i am talking about lightning web components and not the aura components. I have an html file where the custom button is and a javascript file where i can create a function. I have came across:

navigate : function(component, event, helper) { //Find the text value of the component with aura:id set to "address" var address = component.find("address").get("v.value"); var urlEvent = $A.get("e.force:navigateToURL"); urlEvent.setParams({ "url": 'https://www.google.com/maps/place/' + address }); urlEvent.fire(); }

but i don't know how this will work in the lightning web components so guys i need help to open another lightning web component page onclick of a button in another lightning web component page.
MagulanDuraipandianMagulanDuraipandian
You have to use lightning/navigation.
Sample code - https://www.infallibletechie.com/2019/06/lightningdatatable-with-buttons-in.html