Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I have a page block table whilch has two columns one with the data and the other with two buttons to move the records up and down.

I am not able to rerender the column on the change.

The code is as below:

<apex:form >
<apex:pageBlock title="Tab Order in Job Details" id="pb">

        <apex:pageblockTable value="{!objlist}" var="v" style="width:700px" id="Pgb" >

            <apex:column id="col1"> <apex:actionregion id="ar" >   <apex:outputPanel value="{!v.Name}" style="width:20px"/>&nbsp;&nbsp;  <apex:outputText value="{!v.Order__c}" style="width:20px"/>&nbsp;&nbsp; </apex:outputPanel > </apex:column>  

            <apex:column >
            <apex:commandButton value="Up"  title="Move Up" action="{!MoveUp}" reRender="ar" >   <apex:param name="strTabID" value="{!v.id}" assignTo="{!tabid}"/> </apex:commandButton>
                  &nbsp;
                    <apex:commandButton value="Down"  title="Move Down" action="{!MoveDown}"  reRender="ar"> <apex:param name="strTabID"  value="{!v.id}" assignTo="{!tabid}"/></apex:commandButton>
             </apex:column>

        </apex:pageblockTable>            
    </apex:pageBlock>

</apex:form>  

Please can someone suggest how can I achieve this.

Please help.

share|improve this question
3  
If I recall correctly columns can't be rerendered (they could resize table, browser needs to know how to place the content but HTML of a column is spread in several places of document!). And there were some quirks in rerendering tables I think. Can you try rerendering whole pageBlock? –  eyescream Jan 24 '13 at 12:57
    
As eyescream said, you'll need to rerender the entire pageBlock. –  Shailesh Deshpande Jan 24 '13 at 13:32
    
Or rerender the pageblock table, I would have thought. –  Peter Jan 24 '13 at 15:09
    
Hi, Thanks for replying. We have tried by different ways, used page block table, page block, output panel, action region. Is this possible by some other manner? Or should we think of some other way of implementing this? –  Sushma Rao Jan 25 '13 at 5:18
add comment

1 Answer 1

I've taken your sample page and got this working with the following example. There was some interesting behavior with apex:commandButton and apex:param within tables that appears to be hitting a lot of folks, not sure if this was causing you issues? So I switched to apex:commandLink to get this sample working. Anyway I could confirm that indeed, rerendering the pageBlockTable will work as follows.

<apex:page controller="TabOrderController">
    <apex:form id="myform" >
        <apex:pageBlock title="Tab Order in Job Details" id="pb">
            <apex:pageblockTable value="{!Tabs}" var="v" style="width:700px" id="Pgb">
                <apex:column >
                    <apex:outputText value="{!v.Name}" style="width:20px" />  
                </apex:column>
                <apex:column >
                    <apex:commandLink value="Up" title="Move Up" action="{!MoveUp}" rerender="Pgb" >
                        <apex:param name="tabRef" value="{!v.Name}" assignTo="{!tabRef}" />
                    </apex:commandLink>
                    &nbsp;
                    <apex:commandLink value="Down" title="Move Down" action="{!MoveDown}" rerender="Pgb">
                        <apex:param name="tabRef" value="{!v.Name}" assignTo="{!tabRef}"  />
                    </apex:commandLink>
                </apex:column>
            </apex:pageblockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

The controller code is here, just in case it helps. Hopefully this sample will allow you to compare your actual code to see what aspects are causing this sample to work vs yours.

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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