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
LakshmanLakshman 

How to Refresh inline Visulaforce page

Hello All,

 

I have an inline visulaforce page in my Case Pagelayout. I want to refresh it on a particular click event. How can we make it possible. Please help me regarding this issue.

 

 

Thank you!

 

Regards,

Lakshman

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

This javascript call:

 

 

window.location.reload( true );

 

 

should retrieve the visualforce page from the server.

 

You could also redraw the entire record view page (assuming you are using the case standard controller) via:

 

 

 window.top.location='/{!Case.id}';

 

 

All Answers

bob_buzzardbob_buzzard

When you say a particular click event, is this a click in the Visualforce page or elsewhere in the case page layout?

 

Are you looking to save any changes made on the visualforce page and refresh?

 

If so, the following discussion topic should be of use:

 

http://boards.developerforce.com/t5/Visualforce-Development/How-to-refresh-the-page-from-the-visual-force-snippet/m-p/274821

 

if not, can you provide some more information about what you are trying to achieve?

LakshmanLakshman

Hi Bob,

 

Thanks for your comment.

 

My click event is on Visualforce page. Whenever user clicks this button I do some Update operations through Ajax. After these operations I want that my visual force page should get refreshed and the focus should also be maintained to the inline visulaforce frame i.e.. It should not go to top of the page. Is this possible?

 

Thank you!

 

Regards,

Lakshman

LakshmanLakshman

This is my Event

<input type="button" value="Update Order" class="btn" onClick="writeDB();"/>

 

 

Here is pseudo Js Function

 

 

function writeDB()
{
    DML Operation

    After this operations I want to refresh this visualforce page and focus should be on the same visualforce page.
}

bob_buzzardbob_buzzard

You should be able to refresh the Visualforce by executing:

 

 

window.location.reload( true );

 

I'm not aware of any way to tell the browser to revert to the current position after reloading.  Personally I'd call a controller method to save the changes and then just re-render part of the page, but that doesn't fit with the way that your page works.

 

LakshmanLakshman

Hi Bob,

 

 

Can't we just refresh the page after the DML operations are done, can you give me the code for refreshing the complete page after finishing the DML operation in my case.

 

Thank you!

 

Regards,

Lakshman

bob_buzzardbob_buzzard

This javascript call:

 

 

window.location.reload( true );

 

 

should retrieve the visualforce page from the server.

 

You could also redraw the entire record view page (assuming you are using the case standard controller) via:

 

 

 window.top.location='/{!Case.id}';

 

 

This was selected as the best answer
LakshmanLakshman

Thanks for your efforts Bob, its working completely fine with 

 

 window.top.location='/{!Case.id}';

 

 

The first one was giving a continuous pop-up of Resend data.

 

Thanks a lot.

 

If you come to know how to make the focus on the same visualforce page please let me know.

 

Regards,

Lakshman

d.sureshkumar41.33978150573839d.sureshkumar41.33978150573839

Hi bob  I created a visualforce page with four tabs by using next button i could move from one tab to another tab.In the first tab i have some input text fields i want to show these fields as a mandatory fields like inputfields. For that I got red bar what i want is if user didn't enter any data and move next tab by using next button i want to show the error message at that field like ERROR:You must enter a value. PLZ help me

Rajesh SriramuluRajesh Sriramulu
Hi Lakshman,

Have u got the solution, we have the same problem, there is one link in embedded vf page which needs to reload the embedded vf page but it reloads whole page including standard detail page also. But when that button clicks just need to reload the vf page not whole page.

Please let me know if u solves.

Thanks in advance.

Regards,
Rajesh