You need to sign in to do that
Don't have an account?
Hugo Stoupe
Rerender on Command Button is driving me crazy ;)
I have looked at the forums and for some reason, I think my code is complete, however, my page is not re-rendering.
When I click the commandbutton "Create Budget", it works in the background, it creates the budget, but the VF page does not refresh to show me the new budget related list.
Any help?
My VF page
Any suggestions GREATLY appreciated.
When I click the commandbutton "Create Budget", it works in the background, it creates the budget, but the VF page does not refresh to show me the new budget related list.
Any help?
My VF page
<apex:page standardController="CCI_Project__c" extensions="budAddBudget"> <apex:form> <apex:pageblock> <apex:pageblockButtons location="top"> <apex:commandButton value="Create Budget" action="{!addBudget}" reRender="bp"/> </apex:pageblockButtons> </apex:pageblock> <apex:outputPanel id="bp"> <apex:repeat value="{!project}" var="p"> <apex:pageBlock> <apex:pageBlockSection > <apex:outputField value="{!p.Name}"/> <apex:outputField value="{!p.Closed_Opportunity__c}"/> </apex:pageBlockSection> <apex:pageBlockTable value="{!p.Budgets__r}" var="b"> <apex:column value="{!b.Name}"/> <apex:column value="{!b.Start_Date__c}"/> <apex:column value="{!b.Total_Budget__c}"/> <apex:column value="{!b.Total_Actual__c}"/> <apex:column value="{!b.Total_Invoiced_to_Date__c}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:repeat> </apex:outputpanel> </apex:form> </apex:page>The controlling class
public PageReference addBudget() { // Do code this.prj = (CCI_Project__c)standardController.getRecord(); system.debug ('projId ' +prj.id); system.debug('a'); proj = [Select ID, Name, Closed_Opportunity__c From CCI_Project__c Where Id=:prj.Id]; // Call budgetAdd Method in class createBudget cb.budgetAdd(proj.id, proj.Closed_Opportunity__c); return null; }
Any suggestions GREATLY appreciated.
try this
I am not very clear about the code you have but I hope your create method add the new record to the list
All Answers
try this
I am not very clear about the code you have but I hope your create method add the new record to the list
Can you please try this code..
<apex:page standardController="CCI_Project__c" extensions="budAddBudget">
<apex:form>
<apex:pageblock>
<apex:pageblockButtons location="top">
<apex:commandButton value="Create Budget" action="{!addBudget}" reRender="bp,pb"/>
</apex:pageblockButtons>
</apex:pageblock>
<apex:outputPanel id="bp">
<apex:repeat value="{!project}" var="p">
<apex:pageBlock id="pb">
<apex:pageBlockSection >
<apex:outputField value="{!p.Name}"/>
<apex:outputField value="{!p.Closed_Opportunity__c}"/>
</apex:pageBlockSection>
<apex:pageBlockTable value="{!p.Budgets__r}" var="b">
<apex:column value="{!b.Name}"/>
<apex:column value="{!b.Start_Date__c}"/>
<apex:column value="{!b.Total_Budget__c}"/>
<apex:column value="{!b.Total_Actual__c}"/>
<apex:column value="{!b.Total_Invoiced_to_Date__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:repeat>
</apex:outputpanel>
</apex:form>
</apex:page>
Thanks,
Shiva