Environment
- Apex
- Lightning component
Image
sObject のリストから sObject を選ぶと、その sObject が持つフィールドのリストが出る汎用 lightning component の作り方を書きました。https://t.co/Mg2aGk6UHx pic.twitter.com/oYJZMd1SMu
— シン (@shintakapi) September 7, 2019
Code
Usage
In your original application or component, You can use InterlockSelector
component as below like.
Important point
In InterlockSelectorController.js
init
method, this method call an other method ( changeNameAttribute
) which is in same controller.
changeNameAttribute method is handler which runs objectName or fieldName are changed and set correct values.
But, on default, change handler not called when initialization. init handler only called.
So, init method also call changeNameAttribute method above.
The way to call same controller's method is simple.
let anyOtherMethodYouWantCall = component.get('c.anyOtherMethodYouWantCall'); $A.enqueueAction(anyOtherMethodYouWantCall);