How to Use Wrapper Class In Salesforce Lightning Component?

How to Use Wrapper Class In Salesforce Lightning Component?

How to Use Wrapper Class In Salesforce Lightning Component?

A wrapper or container class is a class, a data structure, or an abstract data type which contains different objects or collection of objects as its members.

A snippet of code for Wrapper Class :

Screenshot from 2018-04-06 12-13-31

To use a variable in lightning use @AuraEnabled Annotation  before the variable name. Above wrapper class can be use to show account Details and all its related contact.

A snippet of code for Lightning  Component :

component1

comp

component3

JavaScript Controller for Lightning component :

LightningController

 

Helper For Lightning Component :

LightningHelper

Salesforce Apex Controller :

ApexController

The above lightning component is embedded in a visual force page.

A snippet of code for Salesforce Visualforce Page :

Developer Console

Your Lightning Component Look like Below ScreenShot :

AccountWrap

References:

https://salesforce.stackexchange.com/questions/117627/wrapper-class-knowledgearticleversion-knowledgearticle-for-caseassociation-c

http://sfdcmonkey.com/2017/07/06/use-wrapper-class-lightning-component/

0 Comments

Leave a Reply

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2019 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?