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
    Commented May 25, 2016 at 13:54
  • @Ratan Sorry typo. That is tabForm1
    – SANN3
    Commented May 26, 2016 at 4:22

1 Answer 1

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! :) Commented May 26, 2016 at 6:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .