Action Components :- In our previous Salesforce Tutorial we have learned about Visualforce Data components, what are the different types of Data components. In this Salesforce Training Tutorial we are going to learn about Visualforce Action Components and how Action Components are used in Visualforce Pages.
What are Action Components in Visualforce ?
Action Components are those which allows a controller in to a visualforce page to perform various operations like inserting, updating a page, refreshing a page or navigating to new page.
How Action Components Works ?
If we have written Action component code to refresh a page or to navigate to a new visualforce page first the state of the user interface input elements on the page are injected into the variables of the controller using Setter.
When working with Action components in visualforce we mainly observe two action components they are commandbutton and commandlink.
CommandButton :- Commandbutton is used to insert Hyper markup Text Language (HTML) buttons.
CommandLink :- CommandLInk components is used to insert anchor text to links.
Note :- Both Command Button and Command LInk components are used between <apex:form> and </apex:form> tag only.
Primitive Components.
Some of the primitive components are as follows
OutputPanel | OutputText |
Outputink | Image |
includescript | styleSheet |
iframe |
Generally With regular HTML tags we are able to increase the size of the page, loading time and also able to hide javascript and CSS but visualforce provides attributes to improve performance of the page. We can not insert JavaScript and CSS directly into the HEAD like HTML but in visualforce pages it is not possible where duplication of scripts and stylesheets are not possible.