• Anji Pavuluri
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
Handler3.cmp:
------------------
<aura:component >
    <aura:attribute name="aval" type="Integer"/>
    <aura:attribute name="bval" type="Integer"/>
    <aura:attribute name="cval" type="Integer"/>
    <aura:handler name="init" value="{!this}" action="{!c.test}"/>
    <lightning:card title="Calculation">
        A value:{!v.aval}<br/>
        B value:{!v.bval}<br/>
        C value:{!v.cval}
    </lightning:card>
</aura:component>

Handler3Controller.js
----------------------------
({
    test: function(component, event, helper) {
        var a=component.get("v.aval");
        var b=component.get("v.bval");
        var cval=a+b;
        componet.set("v.cval",cval);
        
        
    }
})
Handler3_App.app
-------------------------
<aura:application extends ="force:slds">
    <c:Handler3 aval="10" bval="20" />
</aura:application>
public class SOQL3_1 {
    public List<Account> accounts{set;get;}
    public SOQL3_1(){
        List<String> listField=new List<String>{'Name','Phone','Rating'};
          String queryString='SELECT Id';
        for(String s:listField){
            queryString=queryString+','+s;
        }
        queryString=queryString+'from Account';
        accounts=Database.query(queryString);
    }
}


<apex:page controller="SOQL3_1">
    <apex:pageBlock title="Accounts Details">
        <apex:pageBlockTable value="{!accounts}" var="a">
         <apex:column value="{!a.name}"/>
         <apex:column value="{!a.phone}"/>
         <apex:column value="{!a.rating}"/>
         <apex:column value="{!a.industry}"/> 
       </apex:pageBlockTable>
    </apex:pageBlock>

</apex:page>