You need to sign in to do that
Don't have an account?
Adding a name/title to apex:pageBlockTable
Hello everyone,
I'm stuck with a question regarding the naming of my pageBlockTable. I have build a custom related List using Visual Force. I am struggling however to add a title to that related List that is on the same level as my button.
This would be the default related list:
Mine is missing the naming.
Here is part of my VF:
<apex:form >
<apex:pageblock id="OppList" >
<div style="margin-left: 30%;" ><apex:commandLink value="Neue Opportunity" action="{!newOpportunity}" target="_parent" styleClass="btn" style="text-decoration:none;padding:4px;"/></div>
<br/>
<apex:pageBlockTable value="{!opportunities}" var="opp" rendered="{!NOT(ISNULL(opportunities))}" title="Contact">
<apex:column HeaderValue="Action" width="100" >
<apex:commandLink value="Bearbeiten" style="color:#015ba7;" action="{!editOpportunity}" target="_parent" ><apex:param value="{!opp.id}" name="OpportunityId"/>
</apex:commandLink>
</apex:column>
<apex:column headerValue="Opportunity Name"><apex:outputLink value="/{!opp.id}" target="_blank">{!opp.Name}</apex:outputLink> </apex:column>
<apex:column value="{!opp.Inhaber_vollst_ndiger_Name__c}"/>
<apex:column value="{!opp.StageName}"/>
<apex:column value="{!opp.Probability}"/>
<apex:column value="{!opp.Amount}"/>
<apex:column value="{!opp.CloseDate}"/>
</apex:pageBlockTable>
You need to use custom styles and output panel
https://salesforce.stackexchange.com/questions/24823/change-style-of-pageblock-header-standard-style
https://developer.salesforce.com/forums/?id=906F0000000DEtKIAW
http://salesforce-stuff.blogspot.com/2011/12/customise-colour-of-pageblocksection.html
https://salesforce.stackexchange.com/questions/88207/how-to-change-color-on-one-particular-pageblocksection
All Answers
<apex:form >
<apex:pageblock id="OppList" title="New Opportunity" >
<div style="margin-left: 30%;" ><apex:commandLink value="Neue Opportunity" action="{!newOpportunity}" target="_parent" styleClass="btn" style="text-decoration:none;padding:4px;"/></div>
<br/>
<apex:pageBlockTable value="{!opportunities}" var="opp" rendered="{!NOT(ISNULL(opportunities))}" title="Contact">
<apex:column HeaderValue="Action" width="100" >
<apex:commandLink value="Bearbeiten" style="color:#015ba7;" action="{!editOpportunity}" target="_parent" ><apex:param value="{!opp.id}" name="OpportunityId"/>
</apex:commandLink>
</apex:column>
<apex:column headerValue="Opportunity Name"><apex:outputLink value="/{!opp.id}" target="_blank">{!opp.Name}</apex:outputLink> </apex:column>
<apex:column value="{!opp.Inhaber_vollst_ndiger_Name__c}"/>
<apex:column value="{!opp.StageName}"/>
<apex:column value="{!opp.Probability}"/>
<apex:column value="{!opp.Amount}"/>
<apex:column value="{!opp.CloseDate}"/>
</apex:pageBlockTable>
thanks for the Insight. Actually I already tried that and the result is this:
It looks like some kind of "linebreak" between the title and my button. They are not on the same level as they are in default related lists.
You need to use custom styles and output panel
https://salesforce.stackexchange.com/questions/24823/change-style-of-pageblock-header-standard-style
https://developer.salesforce.com/forums/?id=906F0000000DEtKIAW
http://salesforce-stuff.blogspot.com/2011/12/customise-colour-of-pageblocksection.html
https://salesforce.stackexchange.com/questions/88207/how-to-change-color-on-one-particular-pageblocksection