You need to sign in to do that
Don't have an account?
How do I print output similar to <apex:detail />
Hello,
I want to write a Visualforce page, and write out the data explicitly rather than use <apex:detail />.
The problem I'm having is I can't seem to find an example of defining # columns to print out the data.
In the Pages Developer Guide, I see examples of <apex:pageBlockTable>, which just loops printing data form a related list; I see an example of <apex:dataTable>, but don't see how to setup the # of columns.
Can someone tell me out to get started. For example, if I wanted to print out Contact details similar to how <apex:detail /> woudl output it, can you give me the first few lines of the Visualforce code?
Thanks,
AT
Hai
Sample Code
<apex:page standardController="StatusManagementDetail__c" extensions="StatusManagementDetailControllerExt" tabStyle="StatusManagementDetail__c" >
<apex:sectionHeader title="StatusManagement" />
<apex:form >
<apex:pageBlock title="StatusManagement Detail" mode="edit" id="block">
<apex:pageBlockButtons >
<apex:commandButton action="{!edit}" value="Edit"/>
<apex:commandButton action="{!delete}" value="Delete" />
</apex:pageBlockButtons>
<apex:pageBlockSection title="Information" id="section1">
<apex:outputField id="Name" value="{!statusManagementDetail.Name}" />
<apex:outputField id="SupportDate" value="{!statusManagementDetail.SupportDate__c}" />
<apex:outputField id="StatusManagementId" value="{!statusManagementDetail.StatusManagementId__c}" />
<apex:outputField id="SupportDeadLine" value="{!statusManagementDetail.SupportDeadLine__c}" />
</apex:pageBlockSection>
<apex:pageBlockSection id="section2" title="System Information">
<apex:outputField id="Status" value="{!statusManagementDetail.Status__c}"/>
<apex:outputField id="ContactOrigin" value="{!statusManagementDetail.ContactOrigin__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection columns="1" id="section3" >
<apex:outputField id="AnswerContent" value="{!statusManagementDetail.AnswerContent__c}"/>
<apex:outputField id="NextTimeAnswerContent" value="{!statusManagementDetail.NextTimeAnswerContent__c}"/>
<apex:outputField id="Comment" value="{!statusManagementDetail.Comment__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Regards
Thanga
All Answers
Hai
Sample Code
<apex:page standardController="StatusManagementDetail__c" extensions="StatusManagementDetailControllerExt" tabStyle="StatusManagementDetail__c" >
<apex:sectionHeader title="StatusManagement" />
<apex:form >
<apex:pageBlock title="StatusManagement Detail" mode="edit" id="block">
<apex:pageBlockButtons >
<apex:commandButton action="{!edit}" value="Edit"/>
<apex:commandButton action="{!delete}" value="Delete" />
</apex:pageBlockButtons>
<apex:pageBlockSection title="Information" id="section1">
<apex:outputField id="Name" value="{!statusManagementDetail.Name}" />
<apex:outputField id="SupportDate" value="{!statusManagementDetail.SupportDate__c}" />
<apex:outputField id="StatusManagementId" value="{!statusManagementDetail.StatusManagementId__c}" />
<apex:outputField id="SupportDeadLine" value="{!statusManagementDetail.SupportDeadLine__c}" />
</apex:pageBlockSection>
<apex:pageBlockSection id="section2" title="System Information">
<apex:outputField id="Status" value="{!statusManagementDetail.Status__c}"/>
<apex:outputField id="ContactOrigin" value="{!statusManagementDetail.ContactOrigin__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection columns="1" id="section3" >
<apex:outputField id="AnswerContent" value="{!statusManagementDetail.AnswerContent__c}"/>
<apex:outputField id="NextTimeAnswerContent" value="{!statusManagementDetail.NextTimeAnswerContent__c}"/>
<apex:outputField id="Comment" value="{!statusManagementDetail.Comment__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Regards
Thanga