function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
atomaratomar 

How to display the detail record underneath the Enhanced List view on the same visual force page.

We have two custom objects (Object A and Object B) and I am using Enhanced List in a visual force page to display both of them under a single tab on the same page.

 

 

 

<apex:page >
<style>
.label
{
font-size: 15px;
color: black;
font-weight:bold;
}
</style>
<apex:pageBlock >
<apex:pageBlockSection >
<apex:outputLabel styleClass="label"><b> Object A</b></apex:outputLabel>
</apex:pageBlockSection>
<apex:enhancedList customizable="true" type="Object_A__c" height="300" rowsPerPage="10" />

<apex:pageBlockSection >
<apex:outputLabel value="Object B" styleClass="label" ></apex:outputLabel>
</apex:pageBlockSection>
<apex:enhancedList customizable="true" type="Object_B__c" height="300" rowsPerPage="10" />
</apex:pageBlock>
</apex:page>

 

 So far so good - but the problem is that when  I click the enhanced list view item the page is redirected to the detail page of the selected record (of the selected object). Our requirement is to display the detail record underneath the Enhanced List view on the same visual force page.

 

How can i do that?

 

michaelforcemichaelforce
It doesn't look like there is much you can do (if anything) to modify the behavior of the enhancedList component... but you may be able to get a pageBlockTable to do what you want by using the "onRowClick" property.  That would allow you to do something custom when a certain record is clicked.
Richie DRichie D

Hi,

 

Perhaps you could override the 'view' standard button of your objects to point to your VF page. If you don't need to see it anywhere else then that'd be fine.

 

If an object is supplied then you can load its details into the bottom of the screen, if not then you just get the enhanced lists. You'd need to rework your VF and controllers a bit though.

 

Might work, then again it might not...

R.