You need to sign in to do that
Don't have an account?

wrapper class data is not displaying lightning page
Hi, i am trying to display wrapper class data in lighning page. But noting is coming. But in cosole.log data is coming. Please help me to findout this thing.
public class accwrapperclass { public class accwrapper { @AuraEnabled public account acc{set;get;} @AuraEnabled public boolean check{set;get;} } } public class selectedaccountslight { @auraEnabled public static list<accwrapperclass.accwrapper> getalldatas() { list<accwrapperclass.accwrapper> accWrapperList = new list<accwrapperclass.accwrapper>(); for(account a1:[select id,name,phone,industry from account ]) { accwrapperclass.accwrapper aw1 = new accwrapperclass.accwrapper(); aw1.check= false; aw1.acc = a1; accWrapperList.add(aw1); } return accWrapperList; } } <aura:component controller="selectedaccountslight"> <aura:handler name="init" value="{!this}" action="{!c.myAction}"/> <aura:attribute name="accwrappervalues" type="accwrapperclass.accwrapper[]" /> <aura:iteration items="{!v.accwrappervalues}" var="data"> {!data.check}.... </aura:iteration> </aura:component> ({ myAction : function(component, event, helper) { var action = component.get("c.getalldatas"); console.log("hello raja"); //Setting the Callback action.setCallback(this,function(a){ //get the response state var state = a.getState(); console.log("hello raja2"); //check if result is successfull if(state == "SUCCESS"){ var wrapdata = a.getReturnValue(); console.log("The wrapdata is: " ,wrapdata); component.get("v.accwrappervalues",wrapdata); } }); //adds the server-side action to the queue $A.enqueueAction(action); console.log("hello raja3"); } })
use
component.set("v.accwrappervalues",wrapdata);
insteadof component.get("v.accwrappervalues",wrapdata);
in your js controller
thanks
Mark it best answer if it helps you so it make proper solution for others :)
Try replacing below you controller.js with the given code.
Let me know if this helps :)
Thanks,
Amit Singh.