I'm trying to dynamically create a picklist in lightning component. But i am facing Access Check Failure

Access Check Failed! Component.setupAttributes():'size' of component 'markup://ui:inputSelect {1:9;a}' is not visible to 'markup://c:DynTbl_Filter_Modal {3:0}

I'm using a Modal popup to display the values of the picklist field. Values are getting populated. But when i close the pop up I find that its throwing the error.

I added access = "global" and also checked access in the object. All that are given fine. I am not sure on what the problem is,

Here is my code : (Only Relevant part) Apex Controller :

global class DynTbl_PicklistSelector  {

    global static string getPicklistSelector(String ObjectName,String fieldstoget)
        List<String> lstFields = fieldstoget.split(',');
        system.debug('Object Name '+ObjectName);
        system.debug('lstFields '+lstFields);
        List<DynTbl_PicklistWrapper> picklists = new list<DynTbl_PicklistWrapper>();
        for(integer i=0;i<lstFields.size();i++){
            String fieldApiName = lstFields.get(i);
            String fieldTypeName = Schema.getGlobalDescribe().get(ObjectName).getDescribe().fields.getMap().get(fieldApiName).getDescribe().getType().name(); 
            System.debug('*** fieldTypeName = ' + fieldTypeName);  
            if(fieldTypeName == 'Picklist'){
                DynTbl_PicklistWrapper plw = new DynTbl_PicklistWrapper();
                plw.PicklistName = fieldApiName;
                List<Schema.PicklistEntry> fieldValues = Schema.getGlobalDescribe().get(ObjectName).getDescribe().fields.getMap().get(fieldApiName).getDescribe().getPicklistValues(); 
                List<string> str=new List<string>();
                for( Schema.PicklistEntry PLE : fieldValues)


                System.debug('*** fieldValues = ' + str);

                }catch(exception e){
                    system.debug('Exception = '+e);
            system.debug('picklists returning'+JSON.serialize(picklists));        
        return JSON.serialize(picklists);
    public class DynTbl_PicklistWrapper {

        public String PicklistName { get;set; }
        public List<string> PicklistValues { get;set; }


Component :

<aura:attribute name="cobject" type="String" default="Account"/>
<aura:attribute name="cfields" type="String[]" default="Id,Name,Industry" />
<aura:attribute name="isOpen" type="boolean" default="false"/>

<button aura:id="auraid1" class="slds-button slds-button_brand" onclick="{!c.openFilterModal}">Filter</button>    
<aura:if isTrue="{!v.isOpen}">
    <div class="slds">
        <div aria-hidden="true" role="dialog" class="slds-modal slds-modal--prompt slds-fade-in-open slds-modal_large" tabindex="-1" aria-labelledby="header99">
            <div class="slds-modal__container">
                <header class="slds-modal__header">
                    <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick="{!c.closeModal}">
                        <lightning:icon iconName="utility:close" size="x-small"/>
                        <span class="slds-assistive-text">Close</span>
                    <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate" onclick="{!c.openFilterModal}" >Filter</h2>
                    <p class="slds-m-top_x-small">Select Values and Apply</p>
                <div aura:id="aid" class="slds-modal__content slds-p-around_medium" id="modal1">
                <footer class="slds-modal__footer">
                    <button class="slds-button slds-button_neutral" onclick="{!c.closeModal}">Cancel</button>
        <div class="slds-backdrop slds-backdrop_open"></div>

js Controller :

    openFilterModal:function(component) {

        component.set("v.isOpen", true);

        var action = component.get("c.getPicklistSelector");
        var fields = component.get("v.cfields");
        //var filterModal = component.find("FilterModal");

            ObjectName : component.get("v.cobject"),
            fieldstoget : fields.join()

            var state = response.getState();
            if(state === 'SUCCESS'){
                var arrVar=JSON.parse(response.getReturnValue());
                console.log('arrVar length = '+arrVar.length);
                for (var i=0;i<arrVar.length;i++){                    
                    var arrVar1=arrVar[i];
                    console.log('external array values = '+arrVar1.PicklistName);
                    var picky = [];
                    for(var j=0;j<arrVar1.PicklistValues.length;j++){
                        var sel = {label:arrVar1.PicklistValues[j],value:arrVar1.PicklistValues[j],text:arrVar1.PicklistValues[j]};
                            "class" : "slds-input",
                            "aura:id": i,
                            "label": arrVar1.PicklistName,
                            "change": component.getReference("c.handlePress")

                        function(dynpicky1, status, errorMessage){
                            //Add the new button to the body array
                            if (status === "SUCCESS") {
                                console.log('dynamic picklist step1');
                                var body = component.get("v.body");

                                console.log('dynamic picklist step2 push'+body);
                                component.set("v.body", body);
                                //console.log("Find Aid"+component.find({ instancesOf : "ui:inputSelect" })[i]);

                            else if (status === "INCOMPLETE") {
                                // Show offline error
                            else if (status === "ERROR") {
                                // Show error message
                        }); //dynamic picklist [i] created
                } //for loop ends here
            else if (state === "ERROR") {
                // Show error message
        }); //set call back ends here

    handlePress: function(component,event,helper)
        console.log('Inside handlePress');

    closeModal : function(component, event, helper) {
        component.set("v.isOpen", false);

Error Image File :

Access Check Failed error is behind this screen

  • It looks like you are creating multiple picklist components. the error says that you are trying to set the Size attribute, and I cannot see that you are doing that. try removing the complexity of you code and see when the problem dispaears – Itai Shmida Sep 3 '17 at 5:15
  • When i remove that Dynamic Input select then no error throws. Only if i add it dynamically , it throws .. Though code is complex .. I dont know where am doing it wrong. – AjaySFDC Sep 3 '17 at 8:30
  • try first adding dynamically one component, and without the server call (static data) -then add the server call, then the other stuff – Itai Shmida Sep 3 '17 at 8:46

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.