Snippets

jprichter Buttons and Actions in the Lightning Experience

Updated by jprichter

File snippet.html Added

  • Ignore whitespace
  • Hide word diff
+<apex:page standardController="Case" showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0">
+
+    <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+
+    <head>
+        <apex:stylesheet value="{!URLFOR($Resource.SLDS, 'assets/styles/salesforce-lightning-design-system.css')}" />
+    </head>
+
+    <body>
+
+    </body>
+
+    </html>
+</apex:page>

File snippet.txt Deleted

  • Ignore whitespace
  • Hide word diff
-<apex:page standardController="Case" showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0">
-
-    <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-
-    <head>
-        <apex:stylesheet value="{!URLFOR($Resource.SLDS, 'assets/styles/salesforce-lightning-design-system.css')}" />
-    </head>
-
-    <body>
-
-    </body>
-
-    </html>
-</apex:page>

File snippet2.html Added

  • Ignore whitespace
  • Hide word diff
+<aura:application access="global" extends="ltng:outApp">
+    <aura:dependency resource="c:MyLightningComponent" />
+</aura:application>

File snippet2.txt Deleted

  • Ignore whitespace
  • Hide word diff
-<aura:application access="global" extends="ltng:outApp">
-    <aura:dependency resource="c:MyLightningComponent" />
-</aura:application>

File snippet3.html Added

  • Ignore whitespace
  • Hide word diff
+<aura:event type="APPLICATION" description="a description of the event">
+    <aura:attribute name="paramA" type="String"/>
+    <aura:attribute name="paramB" type="String" />
+</aura:event>

File snippet3.txt Deleted

  • Ignore whitespace
  • Hide word diff
-<aura:event type="APPLICATION" description="a description of the event">
-    <aura:attribute name="paramA" type="String"/>
-    <aura:attribute name="paramB" type="String" />
-</aura:event>

File snippet4.html Added

  • Ignore whitespace
  • Hide word diff
+<aura:component>
+    <aura:handler event="c:VFPageEvent" action="{!c.handleEvent}" />
+    <aura:attribute name="paramA" type="String" />
+    <aura:attribute name="paramB" type="String" />
+
+    <div>
+        Param A: -- <ui:outputText value="{!v.paramA}" />
+    </div>
+    <div>
+        <ui:button label="Go to Case" press="{!c.goThere}" />
+    </div>
+</aura:component>

File snippet4.txt Deleted

  • Ignore whitespace
  • Hide word diff
-<aura:component>
-    <aura:handler event="c:VFPageEvent" action="{!c.handleEvent}" />
-    <aura:attribute name="paramA" type="String" />
-    <aura:attribute name="paramB" type="String" />
-
-    <div>
-        Param A: -- <ui:outputText value="{!v.paramA}" />
-    </div>
-    <div>
-        <ui:button label="Go to Case" press="{!c.goThere}" />
-    </div>
-</aura:component>

File snippet5.js Added

  • Ignore whitespace
  • Hide word diff
+({
+    handleEvent: function(component, event, helper) {
+        component.set("v.paramA", event.getParam("paramA"));
+        component.set("v.paramB", event.getParam("paramB"));
+
+    },
+    goThere: function(component,event, helper){
+        var caseId = component.get("v.paramB");
+        sforce.one.navigateToSObject(caseId.substring(0, 15));
+    }
+})

File snippet5.txt Deleted

  • Ignore whitespace
  • Hide word diff
-({
-    handleEvent: function(component, event, helper) {
-        component.set("v.paramA", event.getParam("paramA"));
-        component.set("v.paramB", event.getParam("paramB"));
-
-    },
-    goThere: function(component,event, helper){
-        var caseId = component.get("v.paramB");
-        sforce.one.navigateToSObject(caseId.substring(0, 15));
-    }
-})

File snippet6.js Added

  • Ignore whitespace
  • Hide word diff
+goThere: function(component,event, helper){
+    var caseId = component.get("v.paramB");
+    var navEvt = $A.get("e.force:navigateToSObject");
+    navEvt.setParams({
+        "recordId": caseId.substring(0, 15)
+    });
+    navEvt.fire();
+}

File snippet6.txt Deleted

  • Ignore whitespace
  • Hide word diff
-goThere: function(component,event, helper){
-    var caseId = component.get("v.paramB");
-    var navEvt = $A.get("e.force:navigateToSObject");
-    navEvt.setParams({
-        "recordId": caseId.substring(0, 15)
-    });
-    navEvt.fire();
-}

File snippet7.html Added

  • Ignore whitespace
  • Hide word diff
+<apex:includeLightning />
+
+<script>
+$Lightning.use("c:VFAppContainer", function() {
+    $Lightning.createComponent("c:MyLightningComponent", {}, "myLightningComponent", function(cmp) {
+        var event = $A.get("e.c:VFPageEvent");
+        event.setParams({
+            "paramA": "Hello, world",
+            "paramB": "{!Case.Id}"
+        });
+        event.fire();
+    });
+});
+</script>
+
+<div class="slds">
+    <div id="myLightningComponent"></div>
+</div>

File snippet7.txt Deleted

  • Ignore whitespace
  • Hide word diff
-<apex:includeLightning />
-
-<script>
-$Lightning.use("c:VFAppContainer", function() {
-    $Lightning.createComponent("c:MyLightningComponent", {}, "myLightningComponent", function(cmp) {
-        var event = $A.get("e.c:VFPageEvent");
-        event.setParams({
-            "paramA": "Hello, world",
-            "paramB": "{!Case.Id}"
-        });
-        event.fire();
-    });
-});
-</script>
-
-<div class="slds">
-    <div id="myLightningComponent"></div>
-</div>
Updated by jprichter

File snippet.txt Modified

  • Ignore whitespace
  • Hide word diff
-<aura:application access="global" extends="ltng:outApp">
-    <aura:dependency resource="c:MyLightningComponent" />
-</aura:application>
+<apex:page standardController="Case" showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0">
+
+    <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+
+    <head>
+        <apex:stylesheet value="{!URLFOR($Resource.SLDS, 'assets/styles/salesforce-lightning-design-system.css')}" />
+    </head>
+
+    <body>
+
+    </body>
+
+    </html>
+</apex:page>

File snippet2.txt Modified

  • Ignore whitespace
  • Hide word diff
-<aura:event type="APPLICATION" description="a description of the event">
-    <aura:attribute name="paramA" type="String"/>
-    <aura:attribute name="paramB" type="String" />
-</aura:event>
+<aura:application access="global" extends="ltng:outApp">
+    <aura:dependency resource="c:MyLightningComponent" />
+</aura:application>

File snippet3.txt Modified

  • Ignore whitespace
  • Hide word diff
-<aura:component>
-    <aura:handler event="c:VFPageEvent" action="{!c.handleEvent}" />
-    <aura:attribute name="paramA" type="String" />
+<aura:event type="APPLICATION" description="a description of the event">
+    <aura:attribute name="paramA" type="String"/>
     <aura:attribute name="paramB" type="String" />
-
-    <div>
-        Param A: -- <ui:outputText value="{!v.paramA}" />
-    </div>
-    <div>
-        <ui:button label="Go to Case" press="{!c.goThere}" />
-    </div>
-</aura:component>
+</aura:event>

File snippet4.txt Modified

  • Ignore whitespace
  • Hide word diff
-({
-    handleEvent: function(component, event, helper) {
-        component.set("v.paramA", event.getParam("paramA"));
-        component.set("v.paramB", event.getParam("paramB"));
+<aura:component>
+    <aura:handler event="c:VFPageEvent" action="{!c.handleEvent}" />
+    <aura:attribute name="paramA" type="String" />
+    <aura:attribute name="paramB" type="String" />
 
-    },
-    goThere: function(component,event, helper){
-        var caseId = component.get("v.paramB");
-        sforce.one.navigateToSObject(caseId.substring(0, 15));
-    }
-})
+    <div>
+        Param A: -- <ui:outputText value="{!v.paramA}" />
+    </div>
+    <div>
+        <ui:button label="Go to Case" press="{!c.goThere}" />
+    </div>
+</aura:component>

File snippet5.txt Modified

  • Ignore whitespace
  • Hide word diff
-goThere: function(component,event, helper){
-    var caseId = component.get("v.paramB");
-    var navEvt = $A.get("e.force:navigateToSObject");
-    navEvt.setParams({
-        "recordId": caseId.substring(0, 15)
-    });
-    navEvt.fire();
-}
+({
+    handleEvent: function(component, event, helper) {
+        component.set("v.paramA", event.getParam("paramA"));
+        component.set("v.paramB", event.getParam("paramB"));
+
+    },
+    goThere: function(component,event, helper){
+        var caseId = component.get("v.paramB");
+        sforce.one.navigateToSObject(caseId.substring(0, 15));
+    }
+})

File snippet6.txt Modified

  • Ignore whitespace
  • Hide word diff
-<apex:includeLightning />
-
-<script>
-$Lightning.use("c:VFAppContainer", function() {
-    $Lightning.createComponent("c:MyLightningComponent", {}, "myLightningComponent", function(cmp) {
-        var event = $A.get("e.c:VFPageEvent");
-        event.setParams({
-            "paramA": "Hello, world",
-            "paramB": "{!Case.Id}"
-        });
-        event.fire();
+goThere: function(component,event, helper){
+    var caseId = component.get("v.paramB");
+    var navEvt = $A.get("e.force:navigateToSObject");
+    navEvt.setParams({
+        "recordId": caseId.substring(0, 15)
     });
-});
-</script>
-
-<div class="slds">
-    <div id="myLightningComponent"></div>
-</div>
+    navEvt.fire();
+}

File snippet7.txt Added

  • Ignore whitespace
  • Hide word diff
+<apex:includeLightning />
+
+<script>
+$Lightning.use("c:VFAppContainer", function() {
+    $Lightning.createComponent("c:MyLightningComponent", {}, "myLightningComponent", function(cmp) {
+        var event = $A.get("e.c:VFPageEvent");
+        event.setParams({
+            "paramA": "Hello, world",
+            "paramB": "{!Case.Id}"
+        });
+        event.fire();
+    });
+});
+</script>
+
+<div class="slds">
+    <div id="myLightningComponent"></div>
+</div>
Created by jprichter

File snippet.txt Added

  • Ignore whitespace
  • Hide word diff
+<aura:application access="global" extends="ltng:outApp">
+    <aura:dependency resource="c:MyLightningComponent" />
+</aura:application>

File snippet2.txt Added

  • Ignore whitespace
  • Hide word diff
+<aura:event type="APPLICATION" description="a description of the event">
+    <aura:attribute name="paramA" type="String"/>
+    <aura:attribute name="paramB" type="String" />
+</aura:event>

File snippet3.txt Added

  • Ignore whitespace
  • Hide word diff
+<aura:component>
+    <aura:handler event="c:VFPageEvent" action="{!c.handleEvent}" />
+    <aura:attribute name="paramA" type="String" />
+    <aura:attribute name="paramB" type="String" />
+
+    <div>
+        Param A: -- <ui:outputText value="{!v.paramA}" />
+    </div>
+    <div>
+        <ui:button label="Go to Case" press="{!c.goThere}" />
+    </div>
+</aura:component>

File snippet4.txt Added

  • Ignore whitespace
  • Hide word diff
+({
+    handleEvent: function(component, event, helper) {
+        component.set("v.paramA", event.getParam("paramA"));
+        component.set("v.paramB", event.getParam("paramB"));
+
+    },
+    goThere: function(component,event, helper){
+        var caseId = component.get("v.paramB");
+        sforce.one.navigateToSObject(caseId.substring(0, 15));
+    }
+})

File snippet5.txt Added

  • Ignore whitespace
  • Hide word diff
+goThere: function(component,event, helper){
+    var caseId = component.get("v.paramB");
+    var navEvt = $A.get("e.force:navigateToSObject");
+    navEvt.setParams({
+        "recordId": caseId.substring(0, 15)
+    });
+    navEvt.fire();
+}

File snippet6.txt Added

  • Ignore whitespace
  • Hide word diff
+<apex:includeLightning />
+
+<script>
+$Lightning.use("c:VFAppContainer", function() {
+    $Lightning.createComponent("c:MyLightningComponent", {}, "myLightningComponent", function(cmp) {
+        var event = $A.get("e.c:VFPageEvent");
+        event.setParams({
+            "paramA": "Hello, world",
+            "paramB": "{!Case.Id}"
+        });
+        event.fire();
+    });
+});
+</script>
+
+<div class="slds">
+    <div id="myLightningComponent"></div>
+</div>
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.