I have lightning component which displays account details, I added that component in a VF page which has select button. Here I want to display error message if nothing is selected.

So I am facing issue to bring check box value into VF page Apex controller

Lightning component Acccomponent:

<aura:component controller="accController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" 

    <aura:attribute name="checked" type="String[]" />

    <tr >
        <td >
                    <div class="uiInput uiInputCheckbox uiInput--default uiInput--checkbox">
                    <label class="slds-checkbox">                

                        <ui:inputCheckbox aura:id="checkboxMCN" text="{!v.acc.Id}" value=""  class="sq-25 checkbox checkbox--defa   ult checkbox--states-1 brm mrs bg-secondary-btn sq-22 a-mid dib" updateOn="change,click"  change="{!c.onCheck}" />
                        <span class="slds-assistive-text">Select row CDH Account</span>

                // remaining code


VF page :


        var accountId = "{!$CurrentPage.parameters.id}";
    $Lightning.use("c:AcccomponentApp", function() {
                                   {"accountId" : accountId}, 


 <apex:pageblockButtons >     
       <apex:commandButton value="SelectAcc" id="Select"  styleClass="hideButton"  action="{!goToAccpage}" />

  <apex:pageMessages />


public PageReference selmethod()

        //This query will return selected value
        List<selected__c> uscpq = [select Id,Account_ID__c from selected__c order by createddate desc limit 1];

        PageReference pr = new PageReference('/apex/pageval');
        return pr;

Sounds like you're trying to do something like this:


  • Good one there! I believe these scenarios are for a VF page wrapped in a lightning component. Would that work the other way around? i.e. ltng component wrapped in an iframe in a VF page? Have you tried it? – Mohit Arora Jul 28 '17 at 18:45

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.