You need to sign in to do that
Don't have an account?
Rajat Mahajan 28
Passing attributes to a dynamically created component not working in NAMESPACE org
Hi All,
I cam across a scenario while making my functionality in lightning a managed package.
Before having a namespace, my functionality was wrking fine where I was able to receive the attributes from another component in the init method perfectly fine when the component was dynamically created.
this attributes stopped coming in child when I create a namespace
Any clues ?
I cam across a scenario while making my functionality in lightning a managed package.
Before having a namespace, my functionality was wrking fine where I was able to receive the attributes from another component in the init method perfectly fine when the component was dynamically created.
this attributes stopped coming in child when I create a namespace
Any clues ?
By default, all org uses 'c' namespace but
once you created a namespace you need to make some changes like if you are referring child component instead of you need to change into
referring below article for more details https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/namespace_using_reference.htm#namespace_using_reference
Mark as best answer if it helps you.
Thanks,
Ghanshyam Choudhari
Hi Ghyanshyam
Thanks for replying, but , that is not my issue, its the attributes that are not getting passed.
Take example:
THIS BELOW IS WRITTEN IN THE HELPER OF MY PARENT COMPONENT
$A.createComponent(
<NAMESPACE>:testcomponent,
{
"registeredSystem" : registeredSystem,
"messages" : component.get("v.messages"),
"accountId" : component.get("v.accountId"),
"acc" : component.get("v.account")
},
function (contentComponent, status, error) {
if (status === "SUCCESS") {
target.set('v.body', contentComponent);
} else {
throw new Error(error);
}
}
);
IN THE CHILD COMPONENT THE ATTRIBUTES WERE GETTING FILLED WHEN NAMESAPCE WAS NOT THERE IN THE ORG, HOWEVER, NOW WHEN I DO
component.get("v.registeredSystem"); in the init method of the child component it does not work, comes as undefined
Please note - the attributes are perfectly declared in child component and were working when managed package namespace was not there
Did you find any solution to the issue?
-BR, KJ