1

this is my div's onclick code:

onclick="{!if(and(calendarDay.active,v.enableCalendarClickedEvent,v.calendarClickedEventType=='calendarDay'),c.handleClick,'')}"

The problem is that only the first two condition in AND are evaluated.. For example:

  • calendarDay.active turns TRUE
  • enableCalendarClickedEvent turns TRUE
  • calendarClickedEventType turns FALSE

I expect the if do nothing, but it acts like condition are all TRUE.. If i change the order of the condition, it ignore always the last one. So, maybe it's a syntax error?

1

It's not a syntax error, but rather a limitation of how expressions operate. AND and OR only accept two parameters, so you have to nest them together:

onclick="{!if(and(calendarDay.active,and(v.enableCalendarClickedEvent,v.calendarClickedEventType=='calendarDay')),c.handleClick,'')}"

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.