• Hugo007
  • NEWBIE
  • 25 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
Hi all,
 
I am stuck with something that I thought was simple but yet it does not wok!
 
When I try the code below, I expect that when I press ENTER, it does the same as clicking on the addBtn Button. But it does not. Calling .click() only calls the onclick event of the addBtn. The oncomplete is not called. And therefore, my jsAddItem action function is not called.
 
When I use the javascript console and I call the .click() from there, then it works.  By the way, this only happens when using AJAX: when the rerender is specified on the actionFunction. 
 
Anyone has an idea of what is going on?
 
 
Visual Force page excerpt:
        <apex:form >
            <apex:actionFunction action="{!AddItem}" name="jsAddItem" rerender="pbitems,jspanel">
                <apex:param name="Hostname" value="" assignTo="{!Hostname}"/>
            </apex:actionFunction>
            <apex:outputPanel rendered="{!NOT(Box__c.Shipped__c)}">
                Type or scan an item identifier (SN, PN, Box Name):&nbsp;
                <apex:inputText value="{!inputValue}" id="theInputId" onkeyup="doAddOnEnter(event);" />
                <apex:commandButton id="addBtn" value="Add" onclick="console.log('Calling onclick');" oncomplete="try{console.log('Calling jsAddItem()');jsAddItem('myhost');} catch(err){ShowError(err.message);}console.log('DONE');" />
            </apex:outputPanel>
<script>
function doAddOnEnter(e){
 var keynum = 0;
 if (window.event) {
 keynum = window.event.keyCode;
 }else if(e.which){
 keynum = e.which;
 } else {
 keynum = event.keyCode
 }
 if (keynum == 13) {
 var button = document.getElementById('{!$Component.addBtn}');
 button.click();
 }
}
</script>            
 </apex:form >
 
 
 
 
Javascript console output when pressing enter while the textbox has focus:
Calling onclick AddItemsToBox:1
 
Javascript console output when calling manually:
document.getElementById('j_id0:pbitems:j_id77:addBtn').click();
Calling onclick AddItemsToBox:1
undefined
Calling jsAddItem()
DONE

 

How can I configure the permissions for a Chatter Only profile in my dev org prior to deploying on the Prod org. The Chatter Only license is not available in the Dev org. I don't understand why it is missing from the Dev orgs. I'm was not able to find any solution about this after googling.

 

Anybody has some suggestions.

 

Thanks

  • September 21, 2012
  • Like
  • 0

 

How can I configure the permissions for a Chatter Only profile in my dev org prior to deploying on the Prod org. The Chatter Only license is not available in the Dev org. I don't understand why it is missing from the Dev orgs. I'm was not able to find any solution about this after googling.

 

Anybody has some suggestions.

 

Thanks

  • September 21, 2012
  • Like
  • 0
Hi all,
 
I am stuck with something that I thought was simple but yet it does not wok!
 
When I try the code below, I expect that when I press ENTER, it does the same as clicking on the addBtn Button. But it does not. Calling .click() only calls the onclick event of the addBtn. The oncomplete is not called. And therefore, my jsAddItem action function is not called.
 
When I use the javascript console and I call the .click() from there, then it works.  By the way, this only happens when using AJAX: when the rerender is specified on the actionFunction. 
 
Anyone has an idea of what is going on?
 
 
Visual Force page excerpt:
        <apex:form >
            <apex:actionFunction action="{!AddItem}" name="jsAddItem" rerender="pbitems,jspanel">
                <apex:param name="Hostname" value="" assignTo="{!Hostname}"/>
            </apex:actionFunction>
            <apex:outputPanel rendered="{!NOT(Box__c.Shipped__c)}">
                Type or scan an item identifier (SN, PN, Box Name):&nbsp;
                <apex:inputText value="{!inputValue}" id="theInputId" onkeyup="doAddOnEnter(event);" />
                <apex:commandButton id="addBtn" value="Add" onclick="console.log('Calling onclick');" oncomplete="try{console.log('Calling jsAddItem()');jsAddItem('myhost');} catch(err){ShowError(err.message);}console.log('DONE');" />
            </apex:outputPanel>
<script>
function doAddOnEnter(e){
 var keynum = 0;
 if (window.event) {
 keynum = window.event.keyCode;
 }else if(e.which){
 keynum = e.which;
 } else {
 keynum = event.keyCode
 }
 if (keynum == 13) {
 var button = document.getElementById('{!$Component.addBtn}');
 button.click();
 }
}
</script>            
 </apex:form >
 
 
 
 
Javascript console output when pressing enter while the textbox has focus:
Calling onclick AddItemsToBox:1
 
Javascript console output when calling manually:
document.getElementById('j_id0:pbitems:j_id77:addBtn').click();
Calling onclick AddItemsToBox:1
undefined
Calling jsAddItem()
DONE

 

I've been using the Developer Console almost all the time now.  I usually have Chrome open, with several tabs - maybe about 10.  I usually only have one developer consolel open, and only sign on to one Salesforce instance.

 

But for the last few days now - I've been getting many "Response from server was 500".  The "Save" button stay's in the "Saving" mode.  I have to close both the Console and the browser before it will reset.

 

If I try to pull up the same object using esclipse and save it - I get "The changes you requested require salesforce.com to temporarily lock your organizatinos's administration setup. However, the administrtion setup has already been locked by another change. Please Wait for the ..."

 

A Few Questions...

 

Is there a speific forum for the Developer Console?

Is there a way to report bugs, or otherwise get to the developers?

What about this specific error - anybody think there is anything I can do about it?

 

Thanks,

 

How can I configure the permissions for a Chatter Only profile in my dev org prior to deploying on the Prod org. The Chatter Only license is not available in the Dev org. I don't understand why it is missing from the Dev orgs. I'm was not able to find any solution about this after googling.

 

Anybody has some suggestions.

 

Thanks

  • September 21, 2012
  • Like
  • 0