1

Please refer link: Lightning Change Event

Suppose we are using handler as follows:

<aura:handler name="change" value="{!v.expenseName}" action="{!c.expenseNameChanged}"/> 

Now, It seems the handler would could the expenseNameChanged method in following two cases:

  1. When User updates the expenseName field from UI (by editing some field in form)
  2. If we update the field from code (may be from helper/controller component of lightning component)

Question: Is it possible that event get fired only when user updates the data from UI (option 1 above) and expenseNameChanged method don't get cal when we update the field from code.

2
  • 1
    Are you using aura component such as ui:inputText ? If yes, won't using change attribute : change="{!c.expenseNameChanged}" would work for you?
    – Praveen
    Commented Nov 7, 2016 at 9:31
  • Thanks Praveen. I am now using change attribute. Could you please refer any doc or link that explains when to use handlers and change attribute. Commented Nov 10, 2016 at 8:15

1 Answer 1

-1

I don't think it is possible.

A simple workaround would be to set a global variable from your helper function - before you update the field, then on the handler function - check if that variable was set, and only then execute your code.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .