function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Amber NeillAmber Neill 

Need just data not label in Visualforce page

I'm very new at this so bear with me.

I'm creating a Visualforce page that shows data in a table.  Not in the traditional apex:table sense, but rather one field per cell.

How do I get just the value in the cell?  I don't want the field label (apex:outputfield isn't working).  I've tried the cheat sheet and the component library and nothing looks like it'll get me what I need.  What am I missing?

Thanks,

Amber

Best Answer chosen by Admin (Salesforce Developers) 
Kevin SwiggumKevin Swiggum

Yes...try taking it out of the pageblock section. I've placed code below (I took out the panelGrid because that wasn't really your problem)

 

Note that I kept the pageBlockSection in there...I just terminated it. I've used that trick before just to get the section header to show up....makes it look like the table is actually in the section even when it's not.

 

<apex:page standardController="Support_Scorecard__c">
<apex:pageblock title="Scorecard for {!Support_Scorecard__c.Owner.Firstname} {!Support_Scorecard__c.Owner.lastname}">
<apex:pageblocksection title="Introduction to Scorecard" collapsible="true" columns="1">
Some introductory text here.
</apex:pageblocksection>


<apex:pageBlocksection collapsible="false" title="Scorecard for {!Support_Scorecard__c.Owner.Firstname} {!Support_Scorecard__c.Owner.lastname} for the {!Support_Scorecard__c.Time_Period__c} of {!Support_Scorecard__c.Beginning_of_Period__c}">  
</apex:pageBlockSection>

 

Your rank {!Support_Scorecard__c.rank__c} out of {!Support_Scorecard__c.out_of__c}
<p></p>
<p></p>
<table border="1" cellpadding="5" cellspacing="2" width="100%">
<tr>
<th>Category</th>
<th>Weight</th>
<th>Worst Case</th>
<th>Best Case</th>
<th>My Performance</th>
<th>My Score</th>
<th>Balance Score</th>
</tr>
<tr>
<td><b>Utilization</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_weight__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_worst__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_best__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_actual__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_score__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_balance_score__c}"/></td>
</tr>
<tr>
<td><b>QA Score</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_weight__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_worst__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_best__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_actual__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_score__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_balance_score__c}"/></td>
</tr>
<tr>
<td><b>CSAT %</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_weight__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_worst__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_best__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_actual__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_score__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_balance_score__c}"/></td>
</tr>
<tr>
<td><b>DSAT %</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_weight__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_worst__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_best__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_actual__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_score__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_balance_score__c}"/></td>
</tr>
<tr>
<td><b>Unscheduled PTO</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_weight__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_worst__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_best__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_actual__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_score__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_balance_score__c}"/></td>
</tr>
<tr>
<td><b>Activity Compliance</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_weight__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_worst__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_best__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_actual__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_score__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_balance_score__c}"/></td>
</tr>
<tr>
<td><b>Total</b></td>
<td align="right">100.00%</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"><b><apex:outputfield value="{!Support_Scorecard__c.total_balance_score__c}"/></b></td>
</tr>
</table>
<p></p>
<p></p>
<p></p>
<p></p>

</apex:pageblock>  
</apex:page>

All Answers

Kevin SwiggumKevin Swiggum

Hey Amber

 

A few options here depending on what you're trying to do.

 

It sounds like you're using apex:pageBlockSection to set up your table? If that's the case, yes...the outputField will display the label.

 

I wonder if instead you might want to try apex:panelGrid instead? Help text here

 

That will let you build the table one cell at a time without all the formatting baggage of pageBlockSection. And outputField should work within the panelGrid without showing the label.

 

Give it a shot and let me know if you're still having trouble. 

 

--Kevin

Amber NeillAmber Neill

Here's what I have now (abreviated for your viewing pleasure):

 

<table border="1" cellpadding="5" cellspacing="2" width="100%">

<tr>
<td><b>Utilization</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_weight__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_worst__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_best__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_actual__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_score__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_balance_score__c}"></apex:outputfield></td>
</tr>

</table>

 

There are lots more rows, but once I get this one pretty I'll just copy and paste.

 

Here's how I modified it:

<apex:panelGrid columns="7" id="theGrid">
    <apex:outputText value="{!Support_Scorecard__c.utilization_weight__c} id="theFirst"/>
    <apex:outputText value="{!Support_Scorecard__c.utilization_worst__c}" id="theSecond"/>
    <apex:outputText value="{!Support_Scorecard__c.utilization_best__c}" id="theThird"/>
    <apex:outputText value="{!Support_Scorecard__c.utilization_actual__c}" id="theFourth"/>

    <apex:outputText value="{!Support_Scorecard__c.utilization_score__c}" id="thefifth"/>
    <apex:outputText value="{!Support_Scorecard__c.utilization_balance_score__c}" id="thesixth"/>

</apex:panelGrid>

 

Trouble is that doesn't show in my HTML table...should it?  Nevermind that the data is showing up as ints rather than the percentages they are.  Would the entirety of my code be helpful?

Thanks!!!!!
Amber

 

Kevin SwiggumKevin Swiggum

So the labels were showing up for the outputField tag even though you didn't have it within a pageblocksection?

 

They shouldn't. The labels should only show up if using outputField within a pageBlockSection...otherwise it just displays the value (at least in my experience).

 

You should be able to use outputField within the panelGrid as well...and that would solve the formatting issue. I didn't understand what you meant by not showing up in your HTML table. I'm wondering if you just need to add the border, cellpadding and cellspacing attributes to make it look more like a table...otherwise just shows up as whitespace

 

Does that help at all?

Amber NeillAmber Neill

I do have it in a pageblocksection.  Is that my problem?  Removing immediately!  Let me poke at it some more and get back to you.

Thanks for the advice!

Amber

Amber NeillAmber Neill

I've decided poking at it isn't efficient!  (Might be the icy weather causing me to be impatient!)

Here's my code:

 

<apex:page standardController="Support_Scorecard__c">
<apex:pageblock title="Scorecard for {!Support_Scorecard__c.Owner.Firstname} {!Support_Scorecard__c.Owner.lastname}">
<apex:pageblocksection title="Introduction to Scorecard" collapsible="true" columns="1">
Some introductory text here.
</apex:pageblocksection>
<apex:pageBlocksection collapsible="false" title="Scorecard for {!Support_Scorecard__c.Owner.Firstname} {!Support_Scorecard__c.Owner.lastname} for the {!Support_Scorecard__c.Time_Period__c} of {!Support_Scorecard__c.Beginning_of_Period__c}">  

Your rank {!Support_Scorecard__c.rank__c} out of {!Support_Scorecard__c.out_of__c}
<p></p>
<apex:panelGrid columns="7" id="theGrid">
    <apex:outputText value="{!Support_Scorecard__c.utilization_weight__c}"/>
    <apex:outputText value="{!Support_Scorecard__c.utilization_worst__c}" id="theSecond"/>
    <apex:outputText value="{!Support_Scorecard__c.utilization_best__c}" id="theThird"/>
    <apex:outputText value="{!Support_Scorecard__c.utilization_actual__c}" id="theFourth"/>
    <apex:outputText value="{!Support_Scorecard__c.utilization_score__c}" id="thefifth"/>
    <apex:outputText value="{!Support_Scorecard__c.utilization_balance_score__c}" id="thesixth"/>
</apex:panelGrid>
<p></p>
<table border="1" cellpadding="5" cellspacing="2" width="100%">
<tr>
<th>Category</th>
<th>Weight</th>
<th>Worst Case</th>
<th>Best Case</th>
<th>My Performance</th>
<th>My Score</th>
<th>Balance Score</th>
</tr>
<tr>
<td><b>Utilization</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_weight__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_worst__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_best__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_actual__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_score__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_balance_score__c}"></apex:outputfield></td>
</tr>
<tr>
<td><b>QA Score</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_weight__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_worst__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_best__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_actual__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_score__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_balance_score__c}"></apex:outputfield></td>
</tr>
<tr>
<td><b>CSAT %</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_weight__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_worst__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_best__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_actual__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_score__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_balance_score__c}"></apex:outputfield></td>
</tr>
<tr>
<td><b>DSAT %</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_weight__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_worst__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_best__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_actual__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_score__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_balance_score__c}"></apex:outputfield></td>
</tr>
<tr>
<td><b>Unscheduled PTO</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_weight__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_worst__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_best__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_actual__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_score__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_balance_score__c}"></apex:outputfield></td>
</tr>
<tr>
<td><b>Activity Compliance</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_weight__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_worst__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_best__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_actual__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_score__c}"></apex:outputfield></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_balance_score__c}"></apex:outputfield></td>
</tr>
<tr>
<td><b>Total</b></td>
<td align="right">100.00%</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"><b><apex:outputfield value="{!Support_Scorecard__c.total_balance_score__c}"></apex:outputfield></b></td>
</tr>
</table>
<p></p>
<p></p>
<p></p>
<p></p>
</apex:pageblocksection>
</apex:pageblock>  
</apex:page>

 

Sorry about the formatting!

So there are two attempts at a table to show the results.  One is a grid per the previous post(s).  The second is an HTML table that is being borked by the labels.

My goal is a table (HTML or otherwise) that has labels on the rows and columns and in the body of the table JUST the data values.  I hope this is clear from my code.

Again, thanks for all the help!!!

Amber

Kevin SwiggumKevin Swiggum

Yes...try taking it out of the pageblock section. I've placed code below (I took out the panelGrid because that wasn't really your problem)

 

Note that I kept the pageBlockSection in there...I just terminated it. I've used that trick before just to get the section header to show up....makes it look like the table is actually in the section even when it's not.

 

<apex:page standardController="Support_Scorecard__c">
<apex:pageblock title="Scorecard for {!Support_Scorecard__c.Owner.Firstname} {!Support_Scorecard__c.Owner.lastname}">
<apex:pageblocksection title="Introduction to Scorecard" collapsible="true" columns="1">
Some introductory text here.
</apex:pageblocksection>


<apex:pageBlocksection collapsible="false" title="Scorecard for {!Support_Scorecard__c.Owner.Firstname} {!Support_Scorecard__c.Owner.lastname} for the {!Support_Scorecard__c.Time_Period__c} of {!Support_Scorecard__c.Beginning_of_Period__c}">  
</apex:pageBlockSection>

 

Your rank {!Support_Scorecard__c.rank__c} out of {!Support_Scorecard__c.out_of__c}
<p></p>
<p></p>
<table border="1" cellpadding="5" cellspacing="2" width="100%">
<tr>
<th>Category</th>
<th>Weight</th>
<th>Worst Case</th>
<th>Best Case</th>
<th>My Performance</th>
<th>My Score</th>
<th>Balance Score</th>
</tr>
<tr>
<td><b>Utilization</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_weight__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_worst__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_best__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_actual__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_score__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.utilization_balance_score__c}"/></td>
</tr>
<tr>
<td><b>QA Score</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_weight__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_worst__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_best__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_actual__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_score__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.qa_balance_score__c}"/></td>
</tr>
<tr>
<td><b>CSAT %</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_weight__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_worst__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_best__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_actual__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_score__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.csat_balance_score__c}"/></td>
</tr>
<tr>
<td><b>DSAT %</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_weight__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_worst__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_best__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_actual__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_score__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.dsat_balance_score__c}"/></td>
</tr>
<tr>
<td><b>Unscheduled PTO</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_weight__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_worst__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_best__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_actual__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_score__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.unscheduled_pto_balance_score__c}"/></td>
</tr>
<tr>
<td><b>Activity Compliance</b></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_weight__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_worst__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_best__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_actual__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_score__c}"/></td>
<td align="right"><apex:outputfield value="{!Support_Scorecard__c.activity_compliance_balance_score__c}"/></td>
</tr>
<tr>
<td><b>Total</b></td>
<td align="right">100.00%</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"><b><apex:outputfield value="{!Support_Scorecard__c.total_balance_score__c}"/></b></td>
</tr>
</table>
<p></p>
<p></p>
<p></p>
<p></p>

</apex:pageblock>  
</apex:page>

This was selected as the best answer
Amber NeillAmber Neill

BRILLIANT!  That's exactly what I needed!

Yet again sir you rock!  Are more cookies in order?

Thanks again!
Amber

Kevin SwiggumKevin Swiggum

Excellent!

 

Ha! You've already carried to bins of cookies across the entire country. You, my friend, are paid in full.

 

 

sai.sfsai.sf

Hi,

 

        If the outputfield is checkbox i am not able get the field name.If i include field name as outputlabel check box is displaying under the field name.Can you please help me

SANJUKTA BASAK 3SANJUKTA BASAK 3
It is as simple as <apex:outputfield label="" value="{!Support_Scorecard__c.qa_best__c}"/>

This will show only the value without the label.