You need to sign in to do that
Don't have an account?
Getting a commandButton to refresh the WHOLE page on {!save}
I'm working on a VisualForce page for a custom object. I have apex form inputfields within a styled HTML table to suit the preferred UI layout of the client. Underneath the table is a commandButton for the form, which will action {!save} when clicked. It successfully writes the data from the inputfields - no problem. But when clicked, it just refreshes the iframed VF page element. The result is that the whole page-layout for the object is refreshsed within the embedded VisualForce page, whilst the 'parent' page - the original browser if you will - remains unchanged.
How can I make the commandButton commit the inputfields, and then refresh the browser?
Hope I've explained that clear enough - can try and capture it in screen shots if needed.
I'm not completely sure what you mean but I'll cover 2 scenarios that it could be.
1) You have a command button that just refreshes the page instead of a section.
Wrap your page in
2) You have a custom VF page embedded in a frame of another page.
It might actually be window.opener.location.reload() instead. I haven't used this for a few months.
The javascript is reload() - either way, that doesn't work for what I'm trying to achieve.
The table and save button are in a VisualForce page, embedded in the page layout of the custom object:
http://i.imgur.com/Uo2qL.png
When I hit save, it successfully writes the data from the VForce page to the controlling record, but then just refreshes the embedded frame of the VisualForce page:
http://i.imgur.com/idSWA.png
I want the behaviour of the save button to replicate that of the normal 'Save' button at the top or bottom of the page layout. I can't just rely on these normal save button as it only appears once a field has new data pending to be saved; 'orange' data.
Hmmmm, are you currently using a controller for this or just a VF page?
If you are using an extension, this MIGHT work.
I'm not completely sure it will work. It might just redirect you to this page within the frame, but if we are using the controllers save, hopefully it might refer to the parents save and then do what you want.
Alternatively, window.opener.window.opener.reload(); or window.opener.opener.reload(); might partially work for what you want.
If these don't work, I may be out of ideas for you.