When I have changed value of "Case Type" picklist, Request Detail section is to appear on change of picklist value
I want to show this section on load of this edit page. I am using following code.
<aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
<lightning:inputField fieldName="Type" aura:id ="caseTypeId" onchange="{!c.caseTypeChange}"/>
<aura:if isTrue="{!v.caseTypeValue =='Requests'}">
<br/>
<h3 class="slds-section-title--divider">Request Details</h3>
<div class="slds-grid">
<div class="slds-col">
<span>
<lightning:inputField fieldName="Description" />
</span>
</div>
<div class="slds-col">
<span>
<lightning:inputField fieldName="Subject" />
</span>
</div>
</div>
</aura:if>
component code
doInit: function(component, event, helper) {
//Edit Case
helper.caseTypeChangeHelperFun(component, event);
}, caseTypeChange : function(component, event, helper) {
helper.caseTypeChangeHelperFun(component, event);
},
Helper Code
caseTypeChangeHelperFun: function(component, event){
var caseTypeIdValue=component.find("caseTypeId").get("v.value");
component.set("v.caseTypeValue", caseTypeIdValue);
console.log('--caseTypeIdValue---'+caseTypeIdValue);
},
Problem
When I click on the 'case Type' pick list "request detail" section is showing perfectly.
When I load the "Edit" page and if value is selected as "request" the related section is not showing. This is the problem.