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
johnc82johnc82 

On Change

Will I run into any performance issue or any other problem by having the OnChange event on a lot of fields on a VF page? I'm calling a save function in my controller after a change on each field and doing a rerender of that page section.  Is this ok?

kiranmutturukiranmutturu

why can't you give an option to user to perform all the changes and then go with one save....i think this will good...either user may come back and change the 2nd field after 4 th or 5th field changes are done..in this scenario unnecessary u are calling the controller.. hope you got my point

Andy BoettcherAndy Boettcher

Yeah - that's perfectly fine.  I can see a use case where you want to capture things in-flow.

 

If it were me and if I was employing a custom save method - I would have an Apex:outputPanel section at the top of my page to provide feedback to the user that fields were saving properly.

 

Something like creating an ActionFunction that calls the save - and rerenders the Apex:outputPanel section.  Have each of the fields you're performing the onChange on now instead refer to the ActionFunction to get the rerender to fire.

 

In your save method - have it update a string (that's in the outputPanel) that gives some feedback.

 

-Andy