+ Start a Discussion

Reg: OnRowClick() event in Apex



I used <apex:pageblocktable>  to display all records in VF page.

When i click on each row i would like to display the detail page of particular record at the bottom of pageblocktable.

I tried it using actionsupport with the help of an event "onclick".

But i would like to do this one using "onrowclick" event without using action support.


can any one help me. 







We can define javascript events at various levels , like onRowClick, onRowDblClickfor pageblock level,


and few more for columns [Content of page row ]


what did you mean to show detail page of record ? If you are thinking standard salesforce page ,

then you can load this detal page in some Iframe





Thanks for your reply.

I wrote the below code to display detail page view.



<apex:page standardController="student__c" recordSetVar="s">
    <apex:form >             
                <apex:pageBlockTable value="{!s}" var="x">
                    <apex:column >                           
                        <apex:actionSupport event="onclick" rerender="detail" status="Mystatus">
                            <apex:param name="cid" value="{!x.id}"/>  
            <apex:actionstatus id="Mystatus" starttext="loadind data....." >
                    <apex:facet name="stop">
                        <apex:outputPanel id="detail">
                            <apex:detail subject="{!$CurrentPage.parameters.cid}" relatedList="true"  title="false"/>


I need to do the above  task without using action support. 

please help me.


I feel very happy if u did it.


Use an iframe to open the detail page by sending record id on rowClick using JavaScript code if you want to open Standard Salesforce detail page but if you want to open content of the detail page in output panel then use ApexOutput panel, ActionFunction and a Controller through ActionFunction sent the record id on rowClick into the controller and display the detail in ApexOutput panel.


Below is the sample code to display Standard Salesforce page inside the iframe :


<apex:detail subject="{!account.Id}" relatedList="false" title="false"/>


Can u please send the code...