You need to sign in to do that
Don't have an account?
Arjun Mohan 6
Reuse Components in lightning
Hi All,
I have developed a Reusable Dropdown Component where in admins can select the datasource ,dropdown type(Single select or multi select) based on requirement.
If i us ethe same component twice in same page then the latest value overrides the previous value.
That is
CASE 1:DropDown with Single select and data source is List of opportunities.
CASE 2:DropDown with Multi select and data source is List of Contacts.
Thanks
Arjun.M
I have developed a Reusable Dropdown Component where in admins can select the datasource ,dropdown type(Single select or multi select) based on requirement.
If i us ethe same component twice in same page then the latest value overrides the previous value.
That is
CASE 1:DropDown with Single select and data source is List of opportunities.
CASE 2:DropDown with Multi select and data source is List of Contacts.
Thanks
Arjun.M
At First, you have to create a wrapper class to store the details of opportunities. Since it is not static your values won't override.
Thank you
I had a similar problem in the past that may be the problem you are encoutering. I was using the id field and accessing it through javascript by it's ID. The problem is that if there are multiple instances of your component on the same page, your code will potentially reach outside of it's component and interact with the field from the other component with the same id. I had to switch all of my code to use aura:id and cmp.find.
Here is the documentation: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_cb_find_by_id.htm
Greg Thomson
Lightframe.co
There is a solution in below post of how to use multiple instances of component on VF page :
https://developer.salesforce.com/forums?id=906F000000097wpIAA
Thanks For your Reply,
I can give Aura:ID but as am using Aura:Itiration to generate the Items Aura:Id u cannot Bind.
Thanks
Arjun.M
Thanks For your reply,But am not using VF pages.
Thanks
Arjun.M
Refer the link for Aura:iteration
http://salesforce.stackexchange.com/questions/70861/lightning-auraiteration-how-to-refer-indexvar-variable-inside-loop-to-access