You need to sign in to do that
Don't have an account?
knght4yshua
Maximum call stack size exceeded??
Hey all, I'm getting the following error and I have no idea why:
COMPONENT CODE:
CONTROLLER CODE:
HELPER CODE:
If I comment out this line the error goes away, but then again so does the information I need!:
Any help you can provide is greatly appreciated!
Thanks!
Action failed: ui:inputSelect$controller$valueChange [Maximum call stack size exceeded]
COMPONENT CODE:
<aura:component access="global" controller="DependentPicklistTestController"> <aura:attribute name="object" type="String"/> <aura:attribute name="controllingField" type="String"/> <aura:attribute name="dependentField" type="String"/> <aura:attribute name="selectedValue" type="String"/> <aura:attribute name="fieldName" type="String"/> <aura:attribute name="selectedDependentOption" type="String"/> <aura:attribute name="isDependentDisable" type="Boolean" default="false"/> <aura:handler name="init" value="{!this}" action="{!c.loadOptions}" /> <ui:outputText value="{!v.fieldName}"/>: <ui:inputSelect aura:id="picklistOptions" disabled="{!v.isDependentDisable}" class="slds-input" labelClass="slds-form-element__label" value="{!v.selectedOption}" required="true" onError="{!c.handleError}" onClearErrors="{!c.handleClearError}"/> </aura:component>
CONTROLLER CODE:
({ loadOptions : function(component, event, helper) { helper.getOptionsHp(component, component.get("v.object"), component.get("v.controllingField"), component.get("v.dependentField"), component.get("v.selectedValue")); } })
HELPER CODE:
({ /* * Function to get all picklist values for a controlling/dependent pair */ getOptionsHp: function(component, obj, controllingField, dependentField, selectedValue) { var optionValues = []; var action; if(dependentField == "NULL"){ action = component.get("c.getTopLevelOptionsApx"); action.setParams({ 'obj' : obj, 'field' : controllingField}); } else{ action = component.get("c.getOptionsApx"); action.setParams({ 'obj' : obj, 'controllingField' : controllingField, 'dependentField' : dependentField}); } action.setCallback(this, function(response) { var state = response.getState(); if (state === "SUCCESS" && !$A.util.isEmpty(response.getReturnValue()) && !$A.util.isUndefined(response.getReturnValue())) { var returnedValues = response.getReturnValue(); component.set("v.optionsMap",returnedValues); optionValues.push({ class: "optionClass", label: "--- None ---", value: "--- None ---", selected: true }); if($A.util.isUndefined(selectedValue) || $A.util.isEmpty(selectedValue) || selectedValue == "NULL"){ for(var i = 0; i < returnedValues.length; i++){ optionValues.push({ class: "optionsClass", label: returnedValues[i], value: returnedValues[i] }) } } else{ for(var i = 0; i < Object.values(returnedValues[selectedValue]).length; i++){ optionValues.push({ class: "optionsClass", label: Object.values(returnedValues[selectedValue])[i], value: Object.values(returnedValues[selectedValue])[i] }) } } component.find("picklistOptions").set("v.options",optionValues); } else if(state === "ERROR"){ ('A problem occurred: ' + JSON.stringify(response.error)); } }); $A.enqueueAction(action); } })
If I comment out this line the error goes away, but then again so does the information I need!:
component.find("picklistOptions").set("v.options",optionValues);
Any help you can provide is greatly appreciated!
Thanks!
https://salesforce.stackexchange.com/questions/145406/setcallback-maximum-call-stack-size-exceeded
https://salesforce.stackexchange.com/questions/129573/lightning-locker-service-maximum-call-stack-size-exceeded-on-action-getcallback
https://success.salesforce.com/issues_view?id=a1p3A000000jkqqQAA
https://success.salesforce.com/issues_view?id=a1p3A000000jkqqQAA
Any updates for me here?
Thanks!!
<aura:attribute name="selectedValue" type="String"/>
value="{!v.selectedOption}"
Please fix this beginner's error first.