1

I can't get my VF working quite right. Here is the structure of the row of my table. the values were hard coded in the past, but now i want to change it to values of fields. The problem that I'm having is that when I do <apex:outputText value={!opp.field__c}/> I'm getting the field label. Is there a way to avoid this? I'd prefer not to change my controller.

 <tr style="border:1px solid black">
        <td style="border:1px solid black">External Origin<br />(attributes of the environment)</td>
        <td style="border:1px solid black" valign="top">
            <b>Opportunities</b>
            <div id="ctl03_divOpportunityHTML">
                <ul>
                    <li style='list-style:disc; margin-left:2px'><a href='#4' style='text-decoration:none'>blah</a></li>
                    <li style='list-style:disc; margin-left:2px'><a href='#5' style='text-decoration:none'>blah</a></li>
                    <li style='list-style:disc; margin-left:2px'><a href='#6' style='text-decoration:none'>blah</a></li>
                </ul>
            </div>
        </td>
        <td style="border:1px solid black" valign="top">
            <b>Threats</b>
            <div id="ctl03_divThreatsHTML">
                <ul>
                    <li style='list-style:disc; margin-left:2px'><a href='#7' style='text-decoration:none'>blah</a></li>
                    <li style='list-style:disc; margin-left:2px'><a href='#8' style='text-decoration:none'>blah</a></li>
                    <li style='list-style:disc; margin-left:2px'><a href='#9' style='text-decoration:none'>blah</a></li>
                </ul>
            </div>
        </td>
    </tr>
7
  • 1
    I don't understand your question :/ what do you want to "replace with fields"? There's not a single {!merge field} in sight. You want pieces of CSS to come from some string variables? or say a textarea to appear in the table as unescaped (= dangerous) HTML? Or are you looking for stuff like {!$ObjectType.Opportunity.LabelPlural} so if "Opportunities" is translated it'll be just picked up?
    – eyescream
    Dec 11, 2013 at 15:53
  • Ah, sorry. I want to replace the <ul /> with the value from a custom text area- but i don't want to include it's label Dec 11, 2013 at 16:02
  • <apex:outputText value="{!yourField__c}" escape="false" /> ? Or outputPanel?
    – eyescream
    Dec 11, 2013 at 16:05
  • 4
    You seriously get field label with outputText? weird, should be only with outputField I'd say...
    – eyescream
    Dec 11, 2013 at 16:07
  • 1
    @eyescream, I've had funny-experiences with getting the label to display correctly. I think it only displays the label in a apex:pageBlockSection (maybe a apex:pageBlock too) Dec 11, 2013 at 19:18

1 Answer 1

0

if you just want to display the values - no labels - just do this:

<li>{!MyObject__c.Field__c}</li>

this will display your value - but not editable. if you want to be able to edit the values - you would want to use input text - not inputField

<li><apex:inputText value={!MyObject__c.Field__c}" /></li>

you will not get the label this way

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .