Posts

Showing posts with the label lwc:ref

Salesforce Fact #828 | Reset value of LWC record picker using lwc:ref

Image
In LWC, if there are multiple lightning record pickers present and suppose we need to set/reset the value of a particular one, we can make use of the lwc:ref option. Attached are the screenshots.

Salesforce Fact #649 | LWC template refs in action

Image
With the Spring'23 release, LWC template refs are available now. In order to use this in LWC, we need to enable Lightning Web Security first using the below step: Setup -> Session Settings -> Under the section 'Lightning Web Security' select the checkbox for enabling LWS for LWC. After this, we can use lwc:ref in our code. In this example, we have a textinput and we are getting the label and value using template refs when the input is getting changed. Reference:  https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.reference_directives Attached are the screenshots.