I have created a custom lookup based on below link:


Here is my component code:

<aura:attribute name="conList" type="contact[]" description="Will retrieve contacts from controller" />
<aura:iteration items="{!v.conList}" var="con">
<td><c:customLookup objectAPIName="Account" selectedRecordId="{!con.AccountId}"/></td>

My scenarios: 1) here i need to get the value of account email from account dynamically based on selection of custom look up

Obsevations: 1) On change Dynamic binding is not happening to '{!con.Account.Email}' field unlike other fields.

I'm unable to lock onchange effect of <c:customLookup />. Tried with <aura:handler name="change" value="{!v.conList}" action="{!c.action}"/> But,this action will fires only if i add or remove a contact from the list. Any idea on how to achieve this?


There are couple reports that changes are not detected in aura:iteration. A couple weeks ago I reported this behaviour back to the lightning repo: https://github.com/forcedotcom/aura/issues/128

I would suggest to extend your c:customLookup and let it throw a custom change event when it is changed and later handle this in your outer component.

<!-- customLookup -->
<aura:registerEvent name="dataChange" type="c:custom_event" />
<ui:inputText change="{!c.lkpChanged}" ....

Your lookup controller:

lkpChanged: function(cmp, evt, helper) {

And in your outer component you catch and handle it:

<aura:handler name="dataChange" event="c:custom_event" action="{!c.dataChanged}" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.