You need to sign in to do that
Don't have an account?
Refresh a field inside a pageblocktable
Hi I have a pageblocktable which displays a row of input fields, which could also consist of text and formula fields. My issue is that, I have a button call Save (quicksave), which saves the displayed record and their child record (rows displayed) without having to refresh the entire page.
How do I refresh the value or get the value to populate when I click Save? It is calculating all the rollup summery fields but not the formula fields inside the pageblocktable.

The value only shows up if I hit Save and Close (redirects to the actual master record), then hit edit button again.
Here is a snippet of what the visualforce looks like. Please let me know if this can be achievable.
Thank you.
How do I refresh the value or get the value to populate when I click Save? It is calculating all the rollup summery fields but not the formula fields inside the pageblocktable.
The value only shows up if I hit Save and Close (redirects to the actual master record), then hit edit button again.
<apex:page standardController="Budget__c" extensions="BudgetController" standardStylesheets="true" > <apex:sectionHeader subtitle="{!Budget__c.Name}" title="Budget Form"/> <apex:form id="BudgetForm"> <apex:pageMessages id="messages"/> <apex:pageBlock title="Budget Edit" mode="edit" id="BudgetpageBlock"> <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!quickSaveBudget}" rerender="messages,BudgetForm, LineItem, test" /> <apex:commandButton value="Save & Close" action="{!saveBudget}"/> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> <apex:actionRegion immediate="true"> <apex:pageBlockSection title="Budget Line Item" > <apex:pageBlockTable value="{!wrapBudget}" var="wrap" id="LineItem"> <apex:column > <apex:commandButton value="Delete" action="{!deleteLineItem}" reRender="LineItem"> <apex:param name="wrpIndxParam" value="{!wrap.indx}" assignTo="{!count}"/> </apex:commandbutton> </apex:column> <apex:column headerValue="Trade"> <apex:inputField value="{!wrap.budget.Trade__c}"/> </apex:column> <apex:column headerValue="Revenue"> <apex:inputField value="{!wrap.budget.Revenue__c}"/> </apex:column> <apex:column headerValue="Allocations"> <apex:inputField value="{!wrap.budget.Allocations__c}"/> </apex:column> </apex:pageBlockTable> </apex:pageBlockSection> </apex:actionRegion> ...................................................................... </apex:pageBlock> </apex:form> </apex:page>
Here is a snippet of what the visualforce looks like. Please let me know if this can be achievable.
Thank you.
Your quickSaveBudget() method is calling saveLintItem() method however that saveLineItem is using wrapBudget list which is not getting repopulated. You need to call the method that populates wrapBudget so that re-render can display the value.
All Answers
Sure this can be achieved, However to pin point the exact changes we need to look at the apex class as well. In nutshell you need to repopulate the wrapBudget list on click of the save button.
When the save button executes and your action "quickSaveBudget" is called you need to call the methods that populate the wrapBudget (which i assume is a list of wrapper class).
Your quickSaveBudget() method is calling saveLintItem() method however that saveLineItem is using wrapBudget list which is not getting repopulated. You need to call the method that populates wrapBudget so that re-render can display the value.