この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細はこちらをご参照ください。
英語に切り替える

Live Agent Visualforce コンポーネントのコードサンプル

このコードサンプルを使用して、Visualforce コンポーネントがチャットウィンドウのカスタマイズにどのように役立つかをテストおよびプレビューします。
次のコードサンプルでは、次のコンポーネントを使用するチャットウィンドウを示します。
  • liveAgent:clientChat
  • liveAgent:clientChatMessages
  • liveAgent:clientChatEndButton
  • liveAgent:clientChatLog
  • liveAgent:clientChatInput
  • liveAgent:clientChatEndButton
1swfobject.registerObject("clippy.codeblock-0", "9");<apex:page showHeader="false">
2<style>
3body { overflow: hidden; width: 100%; height: 100%; padding: 0; margin: 0 }
4#waitingMessage { height: 100%; width: 100%; vertical-align: middle; text-align: center; display: none; }
5#liveAgentClientChat.liveAgentStateWaiting #waitingMessage { display: table; }
6#liveAgentSaveButton, #liveAgentEndButton { z-index: 2; }
7.liveAgentChatInput {
8    height: 25px;
9    border-width: 1px;
10    border-style: solid;
11    border-color: #000;
12    padding: 2px 0 2px 4px;
13    background: #fff;
14    display: block;
15    width: 99%;
16}
17.liveAgentSendButton {
18    display: block;
19    width: 60px;
20    height: 31px;
21    padding: 0 0 3px;
22    position: absolute;
23    top: 0;
24    right: -67px;
25}
26#liveAgentChatLog {
27    width: auto;
28    height: auto;
29    top: 0px;
30    position: absolute;
31    overflow-y: auto;
32    left: 0;
33    right: 0;
34    bottom: 0;
35}
36</style>
37<div style="top: 0; left: 0; right: 0; bottom: 0; position: absolute;">
38<liveAgent:clientchat >
39    <liveAgent:clientChatSaveButton label="Save Chat" />
40    <liveAgent:clientChatEndButton label="End Chat" />
41    <div style="top: 25px; left: 5px; right: 5px; bottom: 5px; position: absolute; z-index: 0;">
42    <liveAgent:clientChatAlertMessage />
43    <liveAgent:clientChatStatusMessage />
44    <table id="waitingMessage" cellpadding="0" cellspacing="0">
45    <tr>
46    <td>Please wait while you are connected to an available agent.</td>
47    </tr>
48    </table>
49    <div style="top: 0; right: 0; bottom: 41px; left: 0; padding: 0; position: absolute; word-wrap: break-word; z-index: 0;">
50    <liveAgent:clientChatLog />
51    </div>
52    <div style="position: absolute; height: auto; right: 0; bottom: 0; left: 0; margin-right: 67px;">
53        <liveagent:clientChatInput /><liveAgent:clientChatSendButton label="Send"/>
54    </div>
55    </div>
56</liveAgent:clientchat>
57</div>
58</apex:page>

上記のコードの結果は、次のようなチャットウィンドウになります。

Live Agent チャットウィンドウ