victorabraham
4/13/2015 - 6:13 AM

Showing how to display dynamic content in visualforce page without using controller defined action methods

Showing how to display dynamic content in visualforce page without using controller defined action methods

<apex:page standardcontroller="Account">
<apex:pageblock title="Account Details">
    <apex:pageblocksection>
        <apex:pageblocksectionitem>{!account.Name}</apex:pageblocksectionitem>
    </apex:pageblocksection>
</apex:pageblock>
<apex:pageblock title="Contacts">
    <apex:form>
        <apex:datatable border="1" cellpadding="4" value="{!account.Contacts}" var="contact">
            <apex:column>
                <apex:outputpanel>
                    <apex:actionsupport event="onmouseover" rerender="detail">
                        <apex:param name="cid" value="{!contact.id}">
                    </apex:param></apex:actionsupport>
                    {! contact.Name}
                </apex:outputpanel>
            </apex:column>
        </apex:datatable>
    </apex:form>
</apex:pageblock>
<apex:outputpanel id="detail">
    <apex:detail relatedlist="false" subject="{!$CurrentPage.parameters.cid}" title="false">
    </apex:detail>
</apex:outputpanel>
</apex:page>