You need to sign in to do that
Don't have an account?
sush
Message Edited by Jon Mountjoy on 05-27-2008 01:51 PM
Message Edited by Jon Mountjoy on 05-27-2008 01:51 PM
How to open a link in a page block
Hi All,
I have created a visual force page where all the records of a custom object are displayed in a table based on the parameters
in URL(Using a Custom Controller).
The records are displayed as a command link so that when the user clicks on it, detail page opens.I'm able to open it in a new window or same window but I want to open the detail page of the record in the same page in a page block (all the records should display in top of the window and detail page should be displayed below in a apge block when ever I click on any record).How is that possible.
This is my Controller class:
public class MySecondController { List<Calls__c> results; public List<Calls__c> getResults() { results=(List<Calls__c>) [select id,name,Member_Id__c,Relationship_Id__c from Calls__c where Member_Id__c = :System.currentPageReference().getParameters().get('memberId') and Relationship_Id__c = :System.currentPageReference().getParameters().get('relationshipId')]; return results; }
My visual force page is
Code:
<apex:page controller="MySecondController"> <apex:form> <apex:pageBlock title="Calls"> <apex:pageBlockSection title="Results" id="results" columns="1"> <apex:pageBlockList value="{!results}" var="l" > <apex:column> <apex:outputLink target="calls12" value="/{!l.id}" id="theLink">{!l.name}</apex:outputLink> </apex:column> </apex:pageBlockList> </apex:pageBlockSection> </apex:pageBlock> <apex:pageBlock id="calls12" ></apex:pageBlock> </apex:form> </apex:page>
I want to display on calls12 page block when ever a link is clicked.
Any pointers will be of great help.
Thanks in advance.
Message Edited by Jon Mountjoy on 05-27-2008 01:51 PM
Message Edited by Jon Mountjoy on 05-27-2008 01:51 PM
Jon Mountjoy_
I think what you are looking for is "rerender", which provides Ajax like functionality. What you can do is modify your link to call back into the controller, which can lookup the details and then update an output field in the pageblock with those details (without even refreshing the page).