You need to sign in to do that
Don't have an account?
SV M
Display Message on PageBlockTable
Hi, I've created a custom, VF Page. It is having two pageBlockTables inside it. When I click a button "Get Records" the two tables should get refreshed. I am trying to refresh my entire page Block but that's not working n my case. I am attaching my page here along with a screenshot of my page.
<apex:page standardController="Account" extensions="newWrapperClass">
<apex:form >
<apex:pageMessages></apex:pageMessages>
<apex:pageBlock id="block">
<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Get Records" action="{!processedRecords}" reRender="table1,table2"/>
<apex:commandButton value="Send Email" action="{!sendEmail}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Detail Records">
<apex:pageBlockTable value="{!wrapperTaskList}" var="wrap" id="table1">
<apex:column >
<apex:inputCheckbox value="{!wrap.selected}"/>
</apex:column>
<apex:column value="{!wrap.chg.Name}" headerValue="Name"/>
<apex:column value="{!wrap.chg.Phone__c}" headerValue="Phone"/>
</apex:pageBlockTable>
<apex:pageBlockTable value="{!existingRecords}" var="sel" id="table2">
<apex:column value="{!sel.Name}" headerValue="Name"/>
<apex:column value="{!sel.Phone__c}" headerValue="Phone"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
<apex:page standardController="Account" extensions="newWrapperClass">
<apex:form >
<apex:pageMessages></apex:pageMessages>
<apex:pageBlock id="block">
<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Get Records" action="{!processedRecords}" reRender="table1,table2"/>
<apex:commandButton value="Send Email" action="{!sendEmail}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Detail Records">
<apex:pageBlockTable value="{!wrapperTaskList}" var="wrap" id="table1">
<apex:column >
<apex:inputCheckbox value="{!wrap.selected}"/>
</apex:column>
<apex:column value="{!wrap.chg.Name}" headerValue="Name"/>
<apex:column value="{!wrap.chg.Phone__c}" headerValue="Phone"/>
</apex:pageBlockTable>
<apex:pageBlockTable value="{!existingRecords}" var="sel" id="table2">
<apex:column value="{!sel.Name}" headerValue="Name"/>
<apex:column value="{!sel.Phone__c}" headerValue="Phone"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
You need to reRender the either <apex:pageBlock> or <apex:pageBlockSection tag instead of tables.
So update your "Get Records" button with either of below lines:
1)
2)
Assign some id to your <apex:pageblocksection> like: And the use this ID in your "Get Records button as below:
Hope this helps!
Thanks,
Suraj