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
dcarmen66dcarmen66 

Visualforce page with multiple components - partial page refresh

I have a visualforce page with two components. One component queries for data for an Account and Opportunity. The other component is a "date picker" component (allows for the selection of the date, time, and duration) and has a partial page refresh. If the date picker component is on a page by itself (commenting out the first component) the partial page refresh works correctly. With both components on the page, the refresh does not work. Is this a limitation of Visualforce?

Best Answer chosen by Admin (Salesforce Developers) 
dcarmen66dcarmen66

After further testing, I determined it was because the other component on the page had a required field. As long as the required field was filled in, everything worked fine. Because of the partial page refresh, the error message wasn't displayed. Not sure if there's a good way around this, but at least I know why it was occurring and I added a message to the page so the users know they have to have the required fields filled in first.

All Answers

dcarmen66dcarmen66

Slight update to this - the partial page refresh in the second component does work if a field in the first component is modified first.

bob_buzzardbob_buzzard

We've done this kind of thing in the past without issue.  Can you post your Visualforce?

dcarmen66dcarmen66

After further testing, I determined it was because the other component on the page had a required field. As long as the required field was filled in, everything worked fine. Because of the partial page refresh, the error message wasn't displayed. Not sure if there's a good way around this, but at least I know why it was occurring and I added a message to the page so the users know they have to have the required fields filled in first.

This was selected as the best answer
bob_buzzardbob_buzzard

You can use actionregion to get around this - it effectively divides up the form and only posts back the fields that relate to the link/button that has been clicked.

dcarmen66dcarmen66

Thanks! I missed that tag in my reading. That helps a lot.