3

I have an abstract extensible Lightning component called Base and a component that implements it that is called Child.

In the Base component, I have a custom renderer that implements the rerender method. The method uses the provided helper and calls some methods on it.

Depending on whether we are in the Base or Child method, the renderer has to do something different. Before Locker Service, we were able to use cmp.getConcreteComponent().helper, but now, I can't find any other options.

I think it's pretty much this issue, but I can't use the solution, I want to execute actual code and I don't feel that the solution there is OK.

  • Won't calling an aura:method of the concrete component which in turn calls the helper work out? – Praveen Dec 29 '16 at 8:14
  • How do I access the concrete component? getConcreteComponent() isn't accessible when Locker Service is activated. – Marc-Antoine Veilleux Dec 29 '16 at 13:23
  • You can use my solution to access child helper with method callconcretecmphelper salesforce.stackexchange.com/questions/118270/… – Nicolas Vuillamy Dec 29 '16 at 16:02
  • @Marc-AntoineVeilleux getConcreteComponent() is exposed on Components you have access to (SecureComponent) when Locker is activated. You just can't directly access the helper. @Praveen made a good suggestion to try going through an aura:method. If you don't see getConcreteComponent on your component then you're probably dealing with a SecureComponentRef, which means you don't have access to that particular component. What is output when you toString the component? – TrevorBliss Dec 29 '16 at 18:02
  • I was wrong, it's getDef() or .helper that isn't exposed. I did check the callconcretecmphelper solution, it's actually in my question. Using this method, it will ignore any linter (because method are strings), we need to serialize object through attributes for return values (so no complex object or function can be returned) and it feels and is an hack. I've check the aura framework code, and there are calls to getDef().getHelper() (or equivalent) everywhere! To me, this is a design flaw pure and simple. @TrevorBliss, where is the best way to give feedback about design issues? – Marc-Antoine Veilleux Dec 29 '16 at 18:42

Your Answer

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

Browse other questions tagged or ask your own question.