SF-PD2 User Interface Practice Question
A developer is building a Lightning Web Component that should be embedded inside a Visualforce page. The LWC must receive a parameter passed from the Visualforce page and send an event back when a button is clicked. Which combination of features enables this integration?
⚠ Common exam trap
The trap here is assuming Lightning Message Service alone can embed an LWC in Visualforce, when embedding actually requires Lightning Out with a dependency app.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Lightning Out with a dependency app, passing the parameter via the component attribute and receiving the event through a callback registered on the app.
Embedding an LWC in Visualforce requires Lightning Out: a dependency app declares the component, and the VF page instantiates it with $Lightning.use and $Lightning.createComponent. Attributes carry the inbound parameter, and an event handler supplied during creation receives events the component fires. Lightning Message Service, URL-addressable Aura wrappers, and JavaScript remoting each address different problems and cannot both pass a parameter in and return an event out in this context.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
lightning:container and Lightning Message Service, using the published message channel to pass both the parameter and the return event.
Why it's wrong here
Lightning Message Service does support cross-DOM communication between Visualforce and LWC, but the container element is lightning:container, which is used for hosting third-party Lightning Out apps, not for embedding an LWC in Visualforce. The correct embedding mechanism for an LWC in Visualforce is a Lightning Out dependency app invoked from the VF page, so naming lightning:container here misidentifies the tool.
- ✗
A Visualforce remoting call using JavaScript remoting to invoke the LWC's controller and pass the parameter as a method argument.
Why it's wrong here
JavaScript remoting calls Apex methods from Visualforce, not LWC component methods. An LWC is not an Apex controller and cannot be invoked through remoting, and remoting provides no path for the LWC to emit an event back to the Visualforce page. This option confuses server-side invocation with client-side component rendering, so it cannot satisfy the embedding or event requirements.
- ✓
Lightning Out with a dependency app, passing the parameter via the component attribute and receiving the event through a callback registered on the app.
Why this is correct
Lightning Out is the supported way to render an LWC inside a Visualforce page. A dependency app exposes the component, the VF page uses $Lightning.use and $Lightning.createComponent to instantiate it, attributes pass the parameter in, and an event handler registered during creation receives events the LWC fires. This accurately matches the required inbound parameter and outbound event pattern for VF-to-LWC integration.
- ✗
An Aura component wrapper using lightning:isUrlAddressable, passing the parameter through the URL and reading it with the navigation mixin.
Why it's wrong here
lightning:isUrlAddressable makes an Aura component reachable by a URL, which is useful for deep linking but not for embedding inside a Visualforce page. It also does not provide a mechanism for a Visualforce page to pass attributes directly to an LWC or to receive an event from it. This option solves a navigation problem rather than the embedding and communication problem described.
About these practice questions
One of 226 original SF-PD2 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Salesforce exam blueprint
This SF-PD2 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SF-PD2 exam.