You need to sign in to do that
Don't have an account?
Sarita Pa 3
Invoke LWC from Another LWC
Hi Team,
I have an LWC as a tost and on that lwc i have a populate button, on click of the Populate button i need to launch a Modal (which is another LWC).
i used below code to do that how ever it is opening in a different tab. I need to open in the same tab.
Below is the code:
Populate(){
var compDetails ={
compDef: "c:populateLwc", (THis is the name of the another LWC which i want to open)
attributes:{
propertyvalue:"500"
}
};
var encodedCompDetails = btoa(JSON.stringify(compDetails);
this[NavigationMixin.Navigate](
{
type: 'standard_webPage',
attributes :{
url:'/one/one.app#'+ encodedCompDetails;
}
}
)
Appreciate your help in advance
I have an LWC as a tost and on that lwc i have a populate button, on click of the Populate button i need to launch a Modal (which is another LWC).
i used below code to do that how ever it is opening in a different tab. I need to open in the same tab.
Below is the code:
Populate(){
var compDetails ={
compDef: "c:populateLwc", (THis is the name of the another LWC which i want to open)
attributes:{
propertyvalue:"500"
}
};
var encodedCompDetails = btoa(JSON.stringify(compDetails);
this[NavigationMixin.Navigate](
{
type: 'standard_webPage',
attributes :{
url:'/one/one.app#'+ encodedCompDetails;
}
}
)
Appreciate your help in advance
>> https://salesforcediaries.com/2020/06/07/navigate-to-lightning-web-component-from-another-lightning-web-component/
The above link has an implementation of calling an lwc from another.
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.