Trailhead Visualforce 画像を表示するページを作成する方法

環境
Salesforce

実装機能

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
標準 Salesforce ヘッダーがなく、Visualforce 画像コンポーネントを使用して画像を表示する
Visualforce ページを作成します。
新しい Visualforce ページを作成する:
表示ラベル: DisplayImage
名前: DisplayImage
ページに標準 Salesforce ヘッダーを表示しない
ページでは Visualforce apex:image コンポーネントを使用して次の画像を表示する:
https://developer.salesforce.com/files/salesforce-developer-network-logo.png
標準 Salesforce ヘッダーがなく、Visualforce 画像コンポーネントを使用して画像を表示する Visualforce ページを作成します。 新しい Visualforce ページを作成する: 表示ラベル: DisplayImage 名前: DisplayImage ページに標準 Salesforce ヘッダーを表示しない ページでは Visualforce apex:image コンポーネントを使用して次の画像を表示する: https://developer.salesforce.com/files/salesforce-developer-network-logo.png
標準 Salesforce ヘッダーがなく、Visualforce 画像コンポーネントを使用して画像を表示する 
Visualforce ページを作成します。

新しい Visualforce ページを作成する:
  表示ラベル: DisplayImage
  名前: DisplayImage
ページに標準 Salesforce ヘッダーを表示しない
ページでは Visualforce apex:image コンポーネントを使用して次の画像を表示する:
https://developer.salesforce.com/files/salesforce-developer-network-logo.png

操作例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<apex:page showHeader="false" >
<apex:image url="https://developer.salesforce.com/files/salesforce-developer-network-logo.png"/>
</apex:page>
<apex:page showHeader="false" > <apex:image url="https://developer.salesforce.com/files/salesforce-developer-network-logo.png"/> </apex:page>
<apex:page showHeader="false" >
    <apex:image url="https://developer.salesforce.com/files/salesforce-developer-network-logo.png"/>
</apex:page>

説明
1.ページに標準 Salesforce ヘッダーを表示しない
showHeader="false"

2.apex:image
HTML <img> タグで表示される画像です。
このコンポーネントを使用して、sObject の項目に対応しないコントローラメソッドのユーザ入力を取得します。
sObject 項目で使用できるのは、<apex:inputfield> と apex:outfield のみです。

url 表示されている画像へのパス。URL または静的リソースかドキュメントの差し込み項目のいずれかとして表されます。

 

Trailhead

Posted by arkgame