You need to sign in to do that
Don't have an account?
sfdotcom
Lightning Component for action support functionality
Hi,
I am new to lightning components. Could you please help me on achieving the actionSupport functionality in lightningcomponents.
Requirement:
If Account Type is "Prospect" then Description will be displayed.
If Account Type is "Customer - Direct" then "Phone" field should be required.
Here is the visualforce page for above requirement. I want the same functionality using Lightning Components. Thanks in Advance.
<apex:page standardController="Account" >
<apex:sectionHeader title="Account" subtitle="Edit Page" />
<apex:form>
<apex:pageBlock title="Account Information" mode="mainDetail">
<apex:pageBlockButtons>
<apex:commandButton value="Save" action="{!save}" />
</apex:pageBlockButtons>
<apex:pageBlockSection title="Info">
<apex:inputField value="{!Account.Name}" />
<apex:pageBlockSectionItem>
<apex:outputLabel> Account Type</apex:outputLabel>
<apex:actionRegion>
<apex:inputField value="{!Account.Type}" >
<apex:actionSupport event="onchange" reRender="showDescription" />
</apex:inputField>
</apex:actionRegion>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockSection title="Details" id="showDescription" >
<apex:inputField value="{!Account.Description}" rendered="{!Account.Type=='Prospect'}" />
<apex:inputField value="{!Account.Phone}" required="{!Account.Type=='Customer - Direct'}" />
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Thank You.
I am new to lightning components. Could you please help me on achieving the actionSupport functionality in lightningcomponents.
Requirement:
If Account Type is "Prospect" then Description will be displayed.
If Account Type is "Customer - Direct" then "Phone" field should be required.
Here is the visualforce page for above requirement. I want the same functionality using Lightning Components. Thanks in Advance.
<apex:page standardController="Account" >
<apex:sectionHeader title="Account" subtitle="Edit Page" />
<apex:form>
<apex:pageBlock title="Account Information" mode="mainDetail">
<apex:pageBlockButtons>
<apex:commandButton value="Save" action="{!save}" />
</apex:pageBlockButtons>
<apex:pageBlockSection title="Info">
<apex:inputField value="{!Account.Name}" />
<apex:pageBlockSectionItem>
<apex:outputLabel> Account Type</apex:outputLabel>
<apex:actionRegion>
<apex:inputField value="{!Account.Type}" >
<apex:actionSupport event="onchange" reRender="showDescription" />
</apex:inputField>
</apex:actionRegion>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockSection title="Details" id="showDescription" >
<apex:inputField value="{!Account.Description}" rendered="{!Account.Type=='Prospect'}" />
<apex:inputField value="{!Account.Phone}" required="{!Account.Type=='Customer - Direct'}" />
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Thank You.
After you take a first stab at your new Lightning Component, post back here with any specific questions you may have and we'd be glad to help.