0

My visual page having a pageBlockTable inside a tab. Also there is a button inside the same tab named Refresh. I need to refresh the pageBlockTable using the refresh button. The following code is not working

Code:

<apex:tab label="Info" name="info" id="info">
    <apex:form id="tabForm1">
        <apex:commandbutton value="Refresh" reRender="tabForm1"/>
        <apex:pageBlockTable value="{!getAllInfo}" var="a">
            <apex:column value="{!a.id}"/>
        </apex:pageBlockTable>
    </apex:form>
</apex:tab>
2
  • 3
    where is tabForm2 ?
    – Ratan Paul
    May 25 '16 at 13:54
  • @Ratan Sorry typo. That is tabForm1
    – SANN3
    May 26 '16 at 4:22
2

Please refer to the changed code below:

Code:

<apex:tab label="Info" name="info" id="info">
    <apex:form id="tabForm1">
        <apex:commandbutton value="Refresh" reRender="pgTbl0"/> <!-- CHANGED HERE -->
        <apex:pageBlockTable value="{!getAllInfo}" var="a" id="pgTbl0"> <!-- AND HERE -->
            <apex:column value="{!a.id}"/>
        </apex:pageBlockTable>
    </apex:form>
</apex:tab>

If this doesn't work, wrap the table in an outputPanel and rerender the outputPanel instead.

1
  • @SANN3 happy to help! :) May 26 '16 at 6:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.