You need to sign in to do that
Don't have an account?
gajawada vaishnavi
navigation between lwc
I want to navigate from one lwc to other lwc or lwc to vf page in salesforce community guest page .
I have used navigation code as below:-
-->for lwc
handleNavigate() {
var compDefinition = {
componentDef: "c:thankyouLeadLwc"
}
var encodedCompDef = btoa(JSON.stringify(compDefinition));
this[NavigationMixin.Navigate]({
type: 'standard__component',
attributes: {
componentName: "c__thankyouLeadLwc",
url: '/one/one.app#' + encodedCompDef
}
});
-->for vf page
handleNavigate(){
this[NavigationMixin.GenerateUrl]({
type: 'standard__webPage',
attributes: {
url: '/apex/Thank_You_Page?'
}
}).then(vfURL => {
window.open(vfURL);
});
}
both the codes are not working...if I use lwc to lwc it is not at all navigating
but from lwc to vf page I am getting page not available
Someone's help is highly apprciated
I have used navigation code as below:-
-->for lwc
handleNavigate() {
var compDefinition = {
componentDef: "c:thankyouLeadLwc"
}
var encodedCompDef = btoa(JSON.stringify(compDefinition));
this[NavigationMixin.Navigate]({
type: 'standard__component',
attributes: {
componentName: "c__thankyouLeadLwc",
url: '/one/one.app#' + encodedCompDef
}
});
-->for vf page
handleNavigate(){
this[NavigationMixin.GenerateUrl]({
type: 'standard__webPage',
attributes: {
url: '/apex/Thank_You_Page?'
}
}).then(vfURL => {
window.open(vfURL);
});
}
both the codes are not working...if I use lwc to lwc it is not at all navigating
but from lwc to vf page I am getting page not available
Someone's help is highly apprciated
Whereas for standard_webPage url is an attribute
I recommend trying with the above syntax using a sample URL
Let me know if this helps, if it does, please close the query by marking it as solved. It may help others in the community. Thank You!
Thanks for the reply
{ "type": "standard__component", "attributes": { "componentName": "c__MyLightningComponent" }, "state": { "myAttr": "attrValue" } }
Here what is the state attribute?