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 commandLink in pageBlockTable. When I click it, I want the dataTable in the same pageBlockTable to render.

At present I can render all records when I click on the commandLink. My requirement is to render just that particular record's dataTable.

Here is my VF page.

<apex:page controller="repeatcontroller1" sidebar="false">
<apex:form >
    <apex:pageBlock >
        <apex:pageBlockTable value="{!CallplanAccounts}" var="status" border="0" cellpadding="6"    cellspacing="13" columnsWidth="3">

            <apex:column headerValue="Name">
                {!status.acc.Name}&nbsp;&nbsp;
            </apex:column>

            <apex:column headerValue="Status">
                {!status.acc.Active__c}&nbsp;&nbsp;
            </apex:column>

            <apex:column >
                <apex:commandLink action="{!Callstatus}" id="renderit" >
                    CallString<apex:param name="cmid" value="{!status.acc.id}" assignTo="{!approveid}" />
                </apex:commandLink> <br/>

                <apex:pageblocksection collapsible="false" rendered="{!visible_comment =='show'}" >

                    <apex:dataTable value="{!status.acc.Call__r}" var="cm" >
                        <apex:column headerValue="Callstring name" >
                            {!cm.name}
                        </apex:column>

                        <apex:column headerValue="Origianl values" >
                            {!cm.Original_Call__c}
                        </apex:column>

                        <apex:column headerValue="Updated values" >
                            <apex:outputField value="{!cm.Updated_Call__c }" >
                                <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton" / >
                            </apex:outputfield>
                        </apex:column>
                    </apex:dataTable>
                </apex:pageblocksection>
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:form>

share|improve this question
3  
I feel you are going to have to extend your question with more detail and code samples to stand a chance of getting some answers to it. Can you be more clear as to what you want to achieve when clicking the commandLink please. –  Andrew Fawcett Feb 4 '13 at 6:43
add comment

2 Answers 2

It really all depends on the list that is being used to render the datatable. At present you are using status.acc.call__r. This, presumably, is unaffected by the specific commandLink that is clicked (status.acc.id).

Instead, consider using a custom list that is generated by the controller specifically in response to the controller's approveid variable (to which status.acc.id is bound). Then, you would simply populate this list in the CallStatus action method.

share|improve this answer
add comment

Given that you'd need to specify a unique ID for the rerender I think you're out of luck with this one. The only real way to achieve the result you want would be to use a different architecture for the page, rolling your own version of the page block table where you can control the rendering.

One option that could work well here is javascript remoting, where you could replace/update the specific entry for the updated record when the call to the apex method completes.

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.