+ Start a Discussion

Lightning Component for action support functionality


I am new to lightning components. Could you please help me on achieving the actionSupport functionality in lightningcomponents.
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:pageBlock title="Account Information" mode="mainDetail">
                <apex:commandButton value="Save" action="{!save}" />
            <apex:pageBlockSection title="Info">
                <apex:inputField value="{!Account.Name}" />
                    <apex:outputLabel> Account Type</apex:outputLabel>
                        <apex:inputField value="{!Account.Type}" >
                            <apex:actionSupport event="onchange" reRender="showDescription" />
            <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'}" />

Thank You.
James LoghryJames Loghry
It sounds like you have a ways to go before you can implement this as a Lightning Component. I'd suggest going through the "Lightning Component Basics" module on Trailhead to get a better understanding of how components work: https://developer.salesforce.com/trailhead/module/lex_dev_lc_basics.

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.