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
Shane Jay HayesShane Jay Hayes 

Cause Button Within VF element on Object to refresh entire page not just VF element

I have a VF element on my object, this element is used to upload an image to the object.  When I hit the upload or delete button it performs the action but then refreshes the object page within the VF element.  I would like it to refresh the entire object.  Hopefully this make sense lol.

Here is the current apex:commandbutton code: 
 
<apex:commandButton id="Accept" action="{!uploadAction}" value="Upload" onclick="return verifyNameLength();"></apex:commandButton>
            <apex:commandButton id="Delete" action="{!deleteAction}" value="Delete" rendered="{!hasPicture}" onclick="return confirm('Are you sure you want to delete the current image?')"></apex:commandButton>
Right now it looks like this (still building) before clicking anything

Before
After hitting upload or delete is looks like

After
The easiest way to fix this would be to have the button performs its action then refresh the entire object page.

Any help is appreciated!
 
Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior
Hello,

It would be helpful if you share your controller's code but let's try without it. Try removing the rendered attribute from the Delete button.

Regards.

Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.