Monday, 20 January 2014

display detail using visualforce page and Ajax

<apex:page standardController="Account" recordSetVar="acts" sidebar="false">

<apex:form id="form">
<apex:pageBlock title="Account info">
 <apex:pageblockSection columns="2">
    <apex:pageblocktable value="{!acts}" var="a">
        <apex:column >
            <apex:commandLink value="{!a.name}" rerender="abc" >
                <apex:param name="aid" value="{!a.id}"   />
                <apex:param name="aname" value="{!a.name}"   />              
            </apex:commandLink>
        </apex:column>
       
        <apex:column value="{!a.type}"/>
           
    </apex:pageblocktable>
   
     <apex:pageblockSection id="abc" title="{!$CurrentPage.parameters.aname}">
    <apex:detail subject="{!$CurrentPage.parameters.aid}" relatedList="false"/>
    </apex:pageblockSection>
   
   
     </apex:pageblockSection>
   
</apex:pageBlock>

 </apex:form>
</apex:page>