This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
init : function(cmp, ev) { | |
var action = cmp.get("c.GetAccountNames"); | |
action.setCallback(this, function(response) { | |
var state = response.getState(); | |
if (state === "SUCCESS") { | |
var accs=response.getReturnValue() | |
var wrappers=new Array(); | |
for (var idx=0; idx<accs.length; idx++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class AccountController | |
{ | |
@AuraEnabled | |
public static List<Account> GetAccountNames() | |
{ | |
return [select id, Name from Account limit 10]; | |
} | |
@AuraEnabled | |
public static List<Account> GetAccountDetails(String idListJSONStr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CasesController { | |
@AuraEnabled | |
public static List<Case> GetRecentCases() | |
{ | |
List<Case> cases=[select id, CaseNumber, Subject, CreatedDate, Status, Priority | |
from Case | |
order by CreatedDate desc | |
limit 5]; | |
return cases; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
getCases : function(component) { | |
var action = component.get("c.GetRecentCases"); | |
var self = this; | |
action.setCallback(this, function(a) { | |
try | |
{ | |
var cases=a.getReturnValue(); | |
console.log('Result = ' + JSON.stringify(cases)); | |
component.set("v.cases", cases); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
doInit : function(component, event, helper) { | |
helper.getCases(component); | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:application controller="CasesController"> | |
<aura:attribute type="Case[]" name="cases" description="casesToIterate" /> | |
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/> | |
<aura:iteration items="{!v.cases}" var="case"> | |
<c:RWDCase case="{!case}" /> | |
</aura:iteration> | |
</aura:application> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:component > | |
<script> | |
var accsListCtrl={ | |
// renders the HTML to display the supplied accounts in bootstrap panels | |
renderAccs : function(accounts) { | |
var markup=''; | |
$.each(accounts, function(idx, acc) { | |
markup+= ' <div class="row-fluid"> \n' + | |
' <div class="col-xs-12 fullwidth"> \n' + | |
' <div class="panel panel-primary"> \n' + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component controller="AccountsListController" implements="flexipage:availableForAllPageTypes"> | |
<link href="/resource/Bootstrap_3_3_2/bootstrap-3.3.2-dist/css/bootstrap.min.css" rel="stylesheet" /> | |
<link class="user" href="/resource/Bootstrap_3_3_2/bootstrap-3.3.2-dist/css/bootstrap-theme.min.css" | |
rel="stylesheet" type="text/css" /> | |
<aura:attribute name="accounts" type="Account[]" /> | |
<aura:handler name="init" value="{!this}" action="{!c.doInit}" /> | |
<div class="container-fluid"> | |
<div class="row-fluid"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page controller="RequiredCtrl" tabstyle="Account" doctype="html-5.0"> | |
<apex:pageMessages id="msgs"/> | |
<apex:form> | |
<apex:pageBlock mode="maindetail"> | |
<apex:pageBlockButtons location="top"> | |
<apex:commandButton value="Save" action="{!save}" /> | |
</apex:pageBlockButtons> | |
<apex:pageBlockSection title="Account Information"> | |
<apex:pageBlockSectionItem> | |
<apex:outputlabel value="Name"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class RequiredCtrl | |
{ | |
public List<Row> rows {get; set;} | |
public String name {get; set;} | |
public Account acc {get; set;} | |
public RequiredCtrl() | |
{ | |
rows=new List<Row>(); | |
rows.add(new Row()); |