访问自定义对象字段值并在VisualForce页面中的HTML标记中显示它们

时间:2016-03-15 16:36:17

标签: html salesforce visualforce custom-object

如何在HTML和Visualforce混合的页面上获取自定义对象字段的值。

1 个答案:

答案 0 :(得分:1)

<apex:page showHeader="false"    controller="Controller004"   >
<html>
  <link href='https://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'/>
<style>
.navbar ul a{font-family: 'Oswald', sans-serif; text-decoration:none;}
</style>
<apex:stylesheet value="{!$Resource.StyleSheet1}"/>
<body>
  <div class="header">
  <apex:image url="{!$Resource.logo}"/>
    <div class="navbar">
     <ul>
           <a href="#">HOME</a>
           <a href="#">SERVICES</a>
           <a href="#">APPOINTMENT</a>
           <a href="#">BLOGS</a>
           <a href="#">CONTACT</a>
           
     </ul>
    </div>
  </div>
<apex:pageBlock >
<apex:pageBlockTable value="{!obj}" var="a">
<apex:outputText value="{!a.Full_Name__c}" />

</apex:pageBlockTable>
</apex:pageBlock>
</body>
</html>
  
</apex:page>
                    

页面的控制器是:

public class Controller004{

public List<Doctor__c> obj{get;set;}
public Controller004(){
obj = [select Full_Name__c, Fee__c, schedule__c from Doctor__c];

}
}