• schulttj
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 6
    Replies

I have a VF page that contains multiple ajax actions.  If a user invokes a second Ajax update before the first has returned, whatever system state was changed in the first action is lost, even though it displays on the screen correctly. 

 

The code below demonstrates the issue.  Type anything into the first input box, then tab out.  Immediately type something in the second box, then tab out.  An ajax update will show the data entered next to each box correctly.  But when the button is clicked, the first update disappears, and the data it manipulated is no longer available.

 

We've instructed our client that they simply need to wait for one field refresh to complete before another is initiated, but this is making them dissatisfied with VisualForce as a platform.  Are there any alternatives?  Is this the intended behavior for ajax in VF? 

 

<apex:page controller="AjaxRefreshController"> <apex:form > <apex:messages /> <p><apex:inputText value="{!a}"> <apex:actionSupport action="{!actionRefreshA}" event="onblur" rerender="aLabel" /> </apex:inputText> <apex:outputLabel value="{!aLabel}" id="aLabel" /></p> <p><apex:inputText value="{!b}"> <apex:actionSupport action="{!actionRefreshB}" event="onblur" rerender="bLabel" /> </apex:inputText> <apex:outputLabel value="{!bLabel}" id="bLabel" /></p> <apex:commandButton action="{!verifyAExists}" value="Does Label A Exist?" /> </apex:form> </apex:page>

 

public class AjaxRefreshController { public String a {get;set;} public String b {get;set;} public String aLabel {get;set;} public String bLabel {get;set;} public PageReference actionRefreshA() { runlong(); aLabel = 'You entered ' + a; return null; } public PageReference actionRefreshB() { runlong(); bLabel = 'You entered ' + b; return null; } public PageReference verifyAExists() { if (aLabel == '' || aLabel == null) { ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'aLabel does not exist', ''); ApexPages.addMessage(myMsg); } else { ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.INFO, 'aLabel exits', ''); ApexPages.addMessage(myMsg); } return null; } // simulate a long-running webservice call private String runlong() { String s = 't'; for (Integer i = 0; i < 30000; i++) { s += 't'; } return s; } }

 

I have a batch job that runs in several production orgs. It has run fine, twice a day, for several weeks now. However, in a few of the orgs in which it runs, I've started getting the error "Unable to write to any of the ACS stores in the alloted time." What does this error mean, why am I getting it, and what can I do about it?

 

Thanks--

  • September 14, 2010
  • Like
  • 0

See below class.  If you execute go() either anonymously or as test method, the method call to get() will throw an SObjectException even though a try/catch exists for that exact exeption!  Anyone seen this before?  Seems very much like a defect to me.  Please let me know if you feel the same way.

 


global class DemoExceptionIssue {


    global testmethod static void go(){
        final String BAD_FIELD_NAME = 'namexxxxx';
        try{
            (new Account()).get(BAD_FIELD_NAME);
        }catch(SObjectException e){
            System.debug('SObjectException caught as expected (1)');
        }
        //YIKES!  This next line will throw SObjectException
        //  in Spring '10 even though try/catch is in method!
        get(new Account(),BAD_FIELD_NAME);
    }
   
    global static Object get(SObject sobj, String fieldName){
        try{
            return sobj.get(fieldName);
        }catch(SObjectException e){
            System.debug('SObjectException caught as expected (2)');
        }
        return null;
    }
   
}
 


 

Hello,

 

I'm getting an error today when trying to save APEX changes in Eclipse:  

 

"Save error: Unable to perform save on all files: PermGen space".

 

Is this a problem in my workspace, or in the SF Org I am developing in?

 

Thank you

I have a VF page that contains multiple ajax actions.  If a user invokes a second Ajax update before the first has returned, whatever system state was changed in the first action is lost, even though it displays on the screen correctly. 

 

The code below demonstrates the issue.  Type anything into the first input box, then tab out.  Immediately type something in the second box, then tab out.  An ajax update will show the data entered next to each box correctly.  But when the button is clicked, the first update disappears, and the data it manipulated is no longer available.

 

We've instructed our client that they simply need to wait for one field refresh to complete before another is initiated, but this is making them dissatisfied with VisualForce as a platform.  Are there any alternatives?  Is this the intended behavior for ajax in VF? 

 

<apex:page controller="AjaxRefreshController"> <apex:form > <apex:messages /> <p><apex:inputText value="{!a}"> <apex:actionSupport action="{!actionRefreshA}" event="onblur" rerender="aLabel" /> </apex:inputText> <apex:outputLabel value="{!aLabel}" id="aLabel" /></p> <p><apex:inputText value="{!b}"> <apex:actionSupport action="{!actionRefreshB}" event="onblur" rerender="bLabel" /> </apex:inputText> <apex:outputLabel value="{!bLabel}" id="bLabel" /></p> <apex:commandButton action="{!verifyAExists}" value="Does Label A Exist?" /> </apex:form> </apex:page>

 

public class AjaxRefreshController { public String a {get;set;} public String b {get;set;} public String aLabel {get;set;} public String bLabel {get;set;} public PageReference actionRefreshA() { runlong(); aLabel = 'You entered ' + a; return null; } public PageReference actionRefreshB() { runlong(); bLabel = 'You entered ' + b; return null; } public PageReference verifyAExists() { if (aLabel == '' || aLabel == null) { ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'aLabel does not exist', ''); ApexPages.addMessage(myMsg); } else { ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.INFO, 'aLabel exits', ''); ApexPages.addMessage(myMsg); } return null; } // simulate a long-running webservice call private String runlong() { String s = 't'; for (Integer i = 0; i < 30000; i++) { s += 't'; } return s; } }