You need to sign in to do that
Don't have an account?
Isses with reRender
Hi,
I am trying to re-render two pageblocks. The first pageblock displays a list of all Accounts and the second pageblock adds the User to add a new Account. The first pageblock re-renders with no issues. however, the second pageblock is not re-rendering. The value stays in the inputfield. Here is my code. Please help.
<apex:page standardController="Account" extensions="AllMyAccts"> <apex:form > <apex:pageBlock id="AcctListBlock"> <apex:pageBlockTable value="{!Accounts}" var="a" columns="2"> <apex:column value="{!a.Name}"> </apex:column> <apex:column value="{!a.AnnualRevenue}"></apex:column> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock id="newAcctBlock"> <apex:pageblocktable var="newacct" value="{!newAcctList}"> <apex:column > <apex:inputField value="{!newacct.name}"></apex:inputField> </apex:column> </apex:pageblocktable> </apex:pageBlock> <apex:commandbutton value="New Account" action="{!newAccount}" reRender="AcctListBlock, newAcctBlock"/> </apex:form> </apex:page>
Thank you in advance.
Hi Singh,
Thanks for the hint. I instantiated a new list of Accounts after the insert and it seem to work now.
All Answers
Hi Flint
I think you can use apex form id instead of pageblocks id for rerender page.
Use following modified code:
Hi Singh,
Thank for your reply. But the second page block still failed to re-render.
Hi flint
can you post code of extension also.
I think newAcctList name is display every time in inputfield.
If you want to reset value of inputfield then set null to newacctlist after performing action of command button.
Hi Singh,
Thanks for the hint. I instantiated a new list of Accounts after the insert and it seem to work now.