5

I've got a really basic component which call an Apex method when we press the Enter key. However, since Spring'16, I've got the following warning message:

WARNING: Access Check Failed! Component.getEvent():'keyup' of component 'markup://ui:inputText {5:2;a}' is not visible to 'markup://[MyNameSpace]:TestApp {1:2;a}'.

This warning is not displayed when I enter values in my ui:inputText, but as soon as I hit Enter (and thus, call my Apex method), entering new values in the field will generate this warning.

I don't understand why this happen, nor do I understand why it only happens after the Apex call. I feel like I'm missing something important about event management in Lightning, so I would like to understand.

I just kept the minimum here so that it's easier to understand:

TestApp.app:

<aura:application >
    <c:TestInput />
</aura:application>


TestInput.cmp:

<aura:component controller="TestInput">
    <ui:inputText keyup="{!c.getInput}"/>    
</aura:component>


TestInputController.js:

({
    getInput : function(component, event, helper) {
        console.log(event);
        if(event.getParam('keyCode') == 13){
            console.log('OK');
            helper.getValueFromServer(component);
        }
    }
})


TestInputHelper.js:

({
    getValueFromServer : function(component) {
        var action = component.get("c.getValueFromServer");

        action.setCallback(this, function(a) {
            if (a.getState() === "SUCCESS") {
                console.log('Callout OK');             
            }  
        });
        $A.enqueueAction(action);
    }
})


TestInput.apxc:

public class TestInput {
    @AuraEnabled
    public static String getValueFromServer() {
        return 'hello';
    }
}

If anyone understands, thanks in advance for the explanation.

  • check the documetation resources.docs.salesforce.com/sfdc/pdf/lightning.pdf Page no 192 Anatomy of an Access Check Warning – Ratan Paul Jan 15 '16 at 10:33
  • Thanks @Ratan I've seen this, but unfortunately I still don't understand why this only happens after the Apex call – Fabien Taillon Jan 15 '16 at 10:36
  • @FabienTaillon Weird i don't get error with your code . – Mohith Shrivastava Jan 15 '16 at 13:20
  • 1
    Sorry I forgot to explain something: this warning is displayed in the browser console, not in the UI directly. But as explained in the doc (developer.salesforce.com/docs/atlas.en-us.lightning.meta/…), "The framework will enforce these access checks more strictly in the future so you shouldn’t ignore them". So I would like to understand now. Also the warning is displayed only in a Spring'16 org. – Fabien Taillon Jan 15 '16 at 13:22
  • I'm getting it too. WARNING: Access Check Failed! Component.getEvent():'blur' of component 'markup://ui:inputText {22:1;0} {lookup}' is not visible to 'markup://c:SOL_LookupContainer {1:2;a}'. – Caspar Harmer Jan 19 '16 at 20:37
3

The keyup event is inherited from the uiEvents interface as is access="GLOBAL" so I think this might be a bug in the access checks logic. I'm pulling in the folks that implemented client side access checks for their help now.

  • 2
    Yes pretty sure this is a bug in our framework components code. We'll be trying to patch it. – Kris Gray Jan 15 '16 at 18:56
  • 1
    Thanks Doug and Kris. I'll just wait for you to confirm, and select it as best answer then :) – Fabien Taillon Jan 15 '16 at 19:13
  • I'm also getting this error on both KeyUp and KeyDown which are the two events that I am handling and invoking a controller method. – Andres Perez Feb 7 '16 at 10:49
  • Any updates on this? I just started getting the same error this afternoon. – James Loghry Mar 11 '16 at 18:02
  • Also getting the same issue. Access warnings being generated after a call to the server. No access warnings before. Any updates? – Adam Mar 18 '16 at 8:41

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.