Skip to content

Instantly share code, notes, and snippets.

({
getData : function(component, helper) {
var action = component.get("c.getOpportunities");
action.setCallback(this, function(response) {
var state = response.getState();
if(component.isValid() && state == 'SUCCESS') {
var records = response.getReturnValue();
component.set("v.opportunityList", records);
<aura:component controller="PaginationController"
implements="force:appHostable,flexipage:availableForAllPageTypes">
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="opportunityList" type="List"
description="opportunitList attribute stores the total number of records returned from Server"/>
<aura:attribute name="pageOpportunityList" type="List"
description="attribute stores list of opportunity to be diaplayed on the basis of pageSize"/>
<aura:attribute name="totalRecSize" type="integer"/>
/**
* Child class extending Abstract class which extended Virtual class
*/
public class ExtendController extends AbstractMarker{
public override decimal discount(Integer markerCount) {
if(markerCount > 10) {
return 1.5;
} else {
return 0.5;
/**
* Declaring and defining Abstract class extending Virtual class
*/
public abstract class AbstractMarker extends Marker {
public override void write(){
system.debug(' ABSTRACTMARKER: writing text with permanent Marker.');
}
// Declaring abstract method
/**
* Child class extending Virtual Class
*/
public class BlueMarker extends Marker{
// overriding write method
public override void write() {
System.debug('BLUEMARKER: writing some text using BlueMarker');
}
}
/**
* Virtual Class with virtual methods
*
*/
public virtual class Marker {
public virtual void write() {
system.debug(' MARKER: writing some text');
}
/**
* this class extends AbstractController and implements abstract method
*/
public class Calculator extends AbstractController {
public Calculator() {
System.debug(' Calculator class extends AbstractController');
}
public override Integer calculate(Integer val1, Integer val2) {
/**
* Abstract Controller, contains instance variable, constructor.
* Abstract class cannot be instantiated and contains one abstract method.
*/
public abstract class AbstractController {
public Integer result;
public Integer getresult() {
if(result != null) {
return result;
} else {
<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global" >
<div class="demo-only slds-grid" style="height: 150px; width: 300px; padding: 2rem;">
<div class="slds-is-fixed">
<div style="position: absolute;">
<ui:inputSelect multiple="true" aura:id="levels" change="{!c.onSelectChange}">
<ui:inputSelectOption text="" label="" value="true"/>
<ui:inputSelectOption text="Pune" label="Pune"/>
<ui:inputSelectOption text="Mumbai" label="Mumbai"/>
<ui:inputSelectOption text="Delhi" label="Delhi"/>
<ui:inputSelectOption text="Bangalore" label="Bangalore"/>
public class AccountRedirectionController {
public string accId;
public string recName;
public AccountRedirectionController(ApexPages.StandardController stdcontroller) {
if(ApexPages.currentPage().getparameters().get('id')!=null) {
accId = ApexPages.currentPage().getparameters().get('id');
recName = [SELECT Id, RecordtypeId, RecordType.name FROM Account where Id =: accId ].RecordType.Name;
}
}