Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 1 character in body
Source Link
sfdcfox
  • 501.7k
  • 21
  • 473
  • 828

As we all know helper methods in lightingLightning usually have the following signature:

openAffiliationCreateDialog : function(component, event) { ... }

My question here, is it possible to stop passing component around and figure it out from current context (i.e. THIS) right inside helper function?

We have some hierarchy of components which share common logic from basic helper through inheritance. And not all of basic helper methods have component as param. Now we need to add some additional functionality inside those methods "without component" which need to access some component attributes. So I'm wondering if there is a better way instead of going and modifying each helper method execution passing component as a param.

As we all know helper methods in lighting usually have the following signature:

openAffiliationCreateDialog : function(component, event) { ... }

My question here, is it possible to stop passing component around and figure it out from current context (i.e. THIS) right inside helper function?

We have some hierarchy of components which share common logic from basic helper through inheritance. And not all of basic helper methods have component as param. Now we need to add some additional functionality inside those methods "without component" which need to access some component attributes. So I'm wondering if there is a better way instead of going and modifying each helper method execution passing component as a param.

As we all know helper methods in Lightning usually have the following signature:

openAffiliationCreateDialog : function(component, event) { ... }

My question here, is it possible to stop passing component around and figure it out from current context (i.e. THIS) right inside helper function?

We have some hierarchy of components which share common logic from basic helper through inheritance. And not all of basic helper methods have component as param. Now we need to add some additional functionality inside those methods "without component" which need to access some component attributes. So I'm wondering if there is a better way instead of going and modifying each helper method execution passing component as a param.

Removed thanks
Source Link
glls
  • 20.3k
  • 19
  • 49
  • 83

As we all know helper methods in lighting usually have the following signature:

openAffiliationCreateDialog : function(component, event) { ... }

My question here, is it possible to stop passing component around and figure it out from current context (i.e. THIS) right inside helper function?

We have some hierarchy of components which share common logic from basic helper through inheritance. And not all of basic helper methods have component as param. Now we need to add some additional functionality inside those methods "without component" which need to access some component attributes. So I'm wondering if there is a better way instead of going and modifying each helper method execution passing component as a param.

Thanks in advance for you help

As we all know helper methods in lighting usually have the following signature:

openAffiliationCreateDialog : function(component, event) { ... }

My question here, is it possible to stop passing component around and figure it out from current context (i.e. THIS) right inside helper function?

We have some hierarchy of components which share common logic from basic helper through inheritance. And not all of basic helper methods have component as param. Now we need to add some additional functionality inside those methods "without component" which need to access some component attributes. So I'm wondering if there is a better way instead of going and modifying each helper method execution passing component as a param.

Thanks in advance for you help

As we all know helper methods in lighting usually have the following signature:

openAffiliationCreateDialog : function(component, event) { ... }

My question here, is it possible to stop passing component around and figure it out from current context (i.e. THIS) right inside helper function?

We have some hierarchy of components which share common logic from basic helper through inheritance. And not all of basic helper methods have component as param. Now we need to add some additional functionality inside those methods "without component" which need to access some component attributes. So I'm wondering if there is a better way instead of going and modifying each helper method execution passing component as a param.

Source Link
wesaw
  • 3.2k
  • 1
  • 21
  • 50

Get component in helper class from current context in Lightning

As we all know helper methods in lighting usually have the following signature:

openAffiliationCreateDialog : function(component, event) { ... }

My question here, is it possible to stop passing component around and figure it out from current context (i.e. THIS) right inside helper function?

We have some hierarchy of components which share common logic from basic helper through inheritance. And not all of basic helper methods have component as param. Now we need to add some additional functionality inside those methods "without component" which need to access some component attributes. So I'm wondering if there is a better way instead of going and modifying each helper method execution passing component as a param.

Thanks in advance for you help