There is custom controller with more than 60 fields and getter/setter. whenever action support call on onchange of picklist, it takes long time to display the result.

I noticed that it runs the getter method of the filed which we have used in the 'rendered' attribute. (for example: rerender ="{!isDisplay}").

any suggestion to avoid this delay?

  • We need more details; what is happening in the onchange method? Can you post the code? As it stands, your question is too vague to be answerable. – Mike Chale Oct 11 '12 at 18:10
  • 1
    If you're doing a callout to the controller via an actionFunction or such to retrieve the picklist values, and this is the cause of the delay, you might want to investigate js-remoting, which is substantially faster. – techtrekker Oct 11 '12 at 18:21
  • Thanks to all, finally we decided to use Jquery for this. – goodForce Oct 12 '12 at 13:43

If you're only changing one thing, wrap the changing element in an apex:actionRegion. Then only part of the form/page info is sent, and the round trip is faster.

Js remoting will be faster, but if you like to use standard visualforce and use less code, actionRegion helps a lot.

| improve this answer | |
  • Agree with Shane, in your case actionRegion tag seems to be best thing to use. It will limit pre/post ajax processing to a limited area and will sure give a speed boost. I blogged about some tricks regarding actionRegion, if that helps : tgerm.com/2010/09/visualforce-actionregion-deep-dive.html – Abhinav Gupta Oct 12 '12 at 4:43
  • I do believe now we can have multiple <apex:forms> in a page too which will make life easier in these scenarios! – Matt Lacey Oct 12 '12 at 4:46
  • 1
    You can have multiple forms in the page, but these contribute in to a single view state, so the entire viewstate will still be posted back when the picklist changes. – Bob Buzzard Oct 12 '12 at 7:47

There are two answers hear that come to mind.

  1. If you have to have an instant response to a picklist change, it pretty much has to be done in Javascript.

  2. Check if you are using transient on variables and properties wherever possible to reduce the side of the viewstate.

| improve this answer | |

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.