Monday, February 13, 2017

What is in lightning component and how to use in lightning components?.

What is <aura:iteration> in lightning component and how to use <aura:iteration> in lightning components?. aura:iteration iterates over a collection of items and renders the body of the tag for each item. Data changes in the collection are rerendered automatically on the page. aura:iteration supports iterations containing components that have server-side dependencies or that can be created exclusively on the client-side. Example Using Data from a Server-Side Controller This example shows a dynamic iteration that displays data from a standard Opportunity object when user clicks on the button. Apex Class: public...

What are Server-Side Controllers in lightning components and how to use server-side controllers?.

What are Server-Side Controllers in lightning components and how to use server-side controllers?. Server-Side Controller Create a server-side controller in Apex and use the @AuraEnabled annotation to enable client- and server-side access to the controller method. Only methods that you have explicitly annotated with @AuraEnabled are exposed. Calling server-side actions aren’t counted against your org’s API limits. However, your server-side controller actions are written in Apex, and as such are subject to all the usual Apex limits. This Apex controller contains a serverEcho action that prepends a string to the value passed in. public...

Tuesday, February 7, 2017

How to know which button was pressed in lightning component?

How to know which button was pressed in lightning component? To find out which button was pressed in a component containing multiple buttons, use Component.getLocalId(). Let’s look at a component that contains multiple buttons. Each button has a unique local ID, set by an aura:id attribute. <!--c:buttonPressed--> <aura:component > <aura:attribute name="whichButton" type="String" /> <p>You clicked: {!v.whichButton}</p> <ui:button aura:id="button1" label="Click me" press="{!c.nameThatButton}"/> <ui:button aura:id="button2" label="Click me too" press="{!c.nameThatButton}"/> </aura:component> Use event.getSource() in...

Monday, February 6, 2017

What are the standard components in lightning components?

What are the standard components in lightning components? Components are reusable applications components. There are 2 types of components in salesforce. 1).Standard components can be used in salesforce one applications as well as in lightning application also. 2).Force.com components can only be used in salesforce one application. Example of standard component is aura:iteration iterates over a collection of items and renders the body of the tag for each item. Data changes in the collection are rendered automatically on the page. aura:iteration supports iterations containing components that have server-side dependencies...

What are Global Value Providers in lightning components?

What are Global Value Providers in lightning components? Global value providers are global values and methods that a component can use in expressions. First we will see how to use $Browser global value provider to check the browser I am running my lightning component. Output is: Similarly, you can check browser information in a client-side controller using $A.get(). ({     checkBrowser: function(component) {         var device = $A.get("$Browser.formFactor");         alert("You are using a " + device);     } }) Similarly,...

How to use conditional statements IF, Else in lightning components?.

How to use conditional statements IF, Else in lightning components?. In the below example components I am using IF and Else conditions in components. IFComp: In the above screen shot I am using aura:attribute  to define variable with name as “change”, data type as boolean for this I assigned a default value as TRUE. In line number seven I am starting IF condition with <aura:if> tag. If you want to define conditional expression in lightning components we have to use <aura:if>  . if the change variable value is TRUE then I am displaying button with test as “I am True”, else I am displaying button with...

Sunday, February 5, 2017

What are Nested components and component composition in lightning?

What are Nested components and component composition in lightning? Component composition is nothing to use to ease the process.  Let’s say if you have 3 to 4 components so instead of calling all those components into your application what we do is create another component which is knows as nested component or wrapper component which calls all these components in itself and then in the application finally we can call that wrapper/Nested component only. To save our time we are going to use this a lot in lightning applications.  Here is the example I have 2 components as shown below Component 1 :  LC.cmp  Component...

Tuesday, May 31, 2016

Salesforce Lightning Design System(SLDS) examples.

Salesforce Lightning Design System(SLDS) Examples: In the below examples i am using static resources that i got from SLDS unmanaged package installation. Once you installed the SLDS package you will get the static resource that contains CSS, Images, Avatars etc.... Example 1: Create a basic example of Salesforce Lightning Design System. <apex:page 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>   <title>Salesforce...
Page 1 of 10312345Next

 
| ,