Created
December 6, 2016 15:55
-
-
Save sankaran1984/4559edc4d7c362787be1b0423b9fad8c to your computer and use it in GitHub Desktop.
Visualforce - Beyond basics
This file contains 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="testcls3_06122016"> | |
<apex:form> | |
<apex:actionFunction name="actionFn_Js" reRender="UserMessage"> | |
<apex:param name="actionName" value="Link-ActionFunction" assignTo="{!actionName}"/> | |
</apex:actionFunction> | |
<apex:panelGrid columns="2"> | |
<!-- commandbutton --> | |
<apex:outputText value="CommandButton"/> | |
<apex:commandButton value="Click me" reRender="UserMessage"> | |
<apex:param name="actionName" value="CommandButton" assignTo="{!actionName}"/> | |
</apex:commandButton> | |
<!-- commandlink --> | |
<apex:outputText value="CommandLink"/> | |
<apex:commandLink value="Click me" reRender="UserMessage"> | |
<apex:param name="actionName" value="CommandLink" assignTo="{!actionName}"/> | |
</apex:commandLink> | |
<!-- actionsupport --> | |
<apex:outputText value="ActionSupport"/> | |
<apex:selectList size="1"> | |
<apex:actionSupport event="onchange" reRender="UserMessage" > | |
<apex:param name="actionName" value="SelectList-ActionSupport" assignTo="{!actionName}"/> | |
</apex:actionSupport> | |
<apex:selectOption itemValue="Option1" itemLabel="Option1" /> | |
<apex:selectOption itemValue="Option2" itemLabel="Option2" /> | |
</apex:selectList> | |
<!-- actionfunction --> | |
<apex:outputText value="ActionFunction"/> | |
<apex:outputLink onclick="actionFn_Js('Link-ActionFunction');return false;"> | |
Click me | |
</apex:outputLink> | |
<!-- User Output Message --> | |
<apex:outputPanel id="UserMessage"> | |
<apex:outputText value="User Message" rendered="{!actionName != Null}"/> | |
<apex:outputText rendered="{!actionName != Null}"> | |
User clicked this action - {!actionName} | |
</apex:outputText> | |
</apex:outputPanel> | |
</apex:panelGrid> | |
</apex:form> | |
</apex:page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment