0

Uncaught Action failed: ui:inputSelect$controller$optionsChange [Cannot read property 'Aa' of null] ....

hi there

cant figure out cause for above error

i'm using ui:inputselect with multi select, there is one radio button in onchange of this radio button i'm seting options for this multi select

i am able to set values only once

there are two sections in my case, there will be next previous buttons and based on the first section given values / data i need to display the data in next section that is in side aura itertaion

the radio button will be in 2nd section, when i fisrt come to 2nd section and click on radio button it is populating values for multi select picklist properly

when i go back to 1st section and again to 2nd section, and now clicking on radio button giving me above error

i'm every time resetting options for ui:inputselect when moving between sections these sections are hiding with slds-hide and the aura iteration list in side second section every time reloads

radio button to hidghlight input select

<ui:inputRadio value="true" label="" labelClass="slds-radio__label  slds-radio--faux" class="slds-radio" aura:id="alSum" text="Entire Lot" name="{!myIndex}" change="{!c.toggleAllOrIndividual}"/>

this is the ui input select need to highlight options

<ui:inputSelect aura:id="otherFltr" multiple="true" value="{!match1.otherFltrVal}" class="{!myIndex+'___ parentClas '+chilIndx+'____ childRow '+' slds-scrollable--y multiSelCustom'}" label="" >
<ui:inputSelectOption class="optionClass" label="" text="" /> 

</ui:inputSelect>

js controller method

        toggleAllOrIndividual: function(component, event, helper){

            if( Array.isArray(component.find("otherFltr"))){
            //var childTag;
            for(var j=0; j<curntComp.length; j++){

            var crntChild  = curntComp[j];

    //these index vars are identifying the current one, this is not falling wrong

            if(crntParentIndex == indexVal){
            var pkOptions = [];
//this result array is a apexcontroller return array of wraper

            for(var idx = 0;idx<resultArray.length; idx++){


            var picklistObj = {
            "class": "optionClass",
            label: resultArray[idx].attValue, 
            value: resultArray[idx].label, 
            selected: "true"
            };
            pkOptions.push( picklistObj );

            }

            }
            console.log('--pkOptions---');
            console.log(pkOptions);

            if(pkOptions.length>0){

            crntChild.set("v.options", pkOptions);

            }


            }

    }

error

eror msg

multi select populated first time without going back(previous) and next to rech this screen again and clicked on radio button

first time wrokig

  • Your JS controller looks completely out of scope. Try posting the relevant JS controller. – Santanu Halder Apr 11 '17 at 12:18
  • @SantanuHalder i have updated the js controller method, And the falling cause is, component.find("auraId") returning array of more than 3 objects(since same aura id can return array of components), in my case when i swap between next and previous buttons then 3 more ui:inputselect components are adding into DOM, and the result is initial page load 3+ added one more 3 after next previous, why this is happening i dont have an idea – SFDC_Igle Apr 11 '17 at 13:08
  • That depends on how your UI elements are rendering. And your JS controller is still irrelevant, what is curntComp? Where have you used the property Aa in your code? – Santanu Halder Apr 11 '17 at 13:22
  • @SantanuHalder this is big component and i cant keep all here and 'Aa' is i didnt defined any where that is showing in ui ninput select, And curntComp is actually a current comp in array of components with same id – SFDC_Igle Apr 11 '17 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.