function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Swaggy BSwaggy B 

shortkey help

I have a component with some field and what not on there, basically I am trying to get a button to click using Shift + c, I have setup the short key via the app. this is what i have in my Component and Script. the ID of my component is called theComponent and the page where I use the component, id is called thePage. when i hit Shift + C nothing happens. 

<script>
sforce.console.addEventListener('SHIFT+C', function() {
                document.getElementById(
                        '{!$Component.thePage.externalComponentId.theComponent.theForm.pageBlockSection.blockButtons.addContact}').click();
            });
    </script>
    <apex:form id="theForm">
    
        <apex:pageBlock mode="detail" id="pageBlockSection" rendered="{!!currentContact}" >
            <apex:pageBlockButtons id="blockButtons">
                <apex:actionStatus id="finishChangedNew" onstart="openPopUp()"/>
                <apex:commandButton id="addContact" alt="Add Contact" value="Add Contact" action="{!addContact}" status="finishChangedNew" onclick="document.getElementById('{!$Component.thePage.externalComponentId.theComponent.theForm.contactId}').value = '';"  />
                <br></br>......etc. </apex:form>
Jim RaeJim Rae
Have you looked at the Javascript log to see what is happening?  Are you sure you have your Component described correctly?
Swaggy BSwaggy B
I did look at the log and there was nothing and Im positive the Component is described right
Jim RaeJim Rae
And, you are running this inside of the console, correct?