+ Start a Discussion
Rakshana Cube84Rakshana Cube84 

Lightning Component - Visualforce page tags

Hi All,

I want to know the equivalent tags for each component in Visualforce page for the Lightning component. I am stuck with something else to understand about the dynamic binding on the Lightning component. Let's see an example:

Visualforce page code:
<apex:page controller="CaseCTRL">
<apex:form>
<apex:inputfield value="{!newcase.Subject}"/>  
<apex:inputfield value="{!newcase.Type}"/>
</apex:form>
</pex:page>

Controller Apex class:
public class CaseCTRL{

public case newcase{get;set;} //Declared a Sobject variable for accessing on VF page
public CaseCTRL(){
newcase = new case(); //Case Sobject varible initialization
}



I hope you could understand that code. I need same equivalent code for the lightning component too. Please, anyone, help me to understand.


Thanks,
Rakshana
Best Answer chosen by Rakshana Cube84
Shruti SShruti S
Visualforce page is not equivalent to Lightning Component. Hence it is not necessary to have a equivalent tag corresponding to a Visualforce tag in Lightning Component. Binding works the same as in Visualforce page except for the fact that your variable will be an <aura:attribute> and these are filled in the Controller.js.

In order to convert a Visualforce Page to Lightning, you need first start thinking in terms of components or breaking down your big page in to small re-usable components. Then we build these small components and finally tie them all up to create the app or the equivalent VF page you had.

For your example, you need to look into lightning:recordEditForm and lightning:inputField.

One of the best ways to learn all the tags is by looking at the Component Library: https://developer.salesforce.com/docs/component-library

All Answers

Shruti SShruti S
Visualforce page is not equivalent to Lightning Component. Hence it is not necessary to have a equivalent tag corresponding to a Visualforce tag in Lightning Component. Binding works the same as in Visualforce page except for the fact that your variable will be an <aura:attribute> and these are filled in the Controller.js.

In order to convert a Visualforce Page to Lightning, you need first start thinking in terms of components or breaking down your big page in to small re-usable components. Then we build these small components and finally tie them all up to create the app or the equivalent VF page you had.

For your example, you need to look into lightning:recordEditForm and lightning:inputField.

One of the best ways to learn all the tags is by looking at the Component Library: https://developer.salesforce.com/docs/component-library
This was selected as the best answer
Rakshana Cube84Rakshana Cube84
Thank you, Shruti.