IUpdateSidePaneRequest
このオブジェクトは、sidePane操作公開APIの更新のリクエスト・オブジェクトとして渡す必要があります。
構文は次のとおりです:
setVisibility(visibility: boolean): void;
関数
setVisibility
次の関数を使用して、sidePaneアイコンの表示を設定します:
setVisibility(visibility: boolean): void;| パラメータ名 | 必須かどうか | 説明 |
|---|---|---|
| 表示 | いいえ | サイド・ペイン・アイコンの表示。 |
次のコード・サンプルは、セクション表示を更新するためにサイド・ペイン操作を更新するためのTypescriptの例を示しています。
const updateSidePaneContext = async () => {
const uiEventsFrameworkInstance: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const sidePaneContext: ISidePaneContext = await uiEventsFrameworkInstance.getSidePaneContext('sidePaneId');
const payload:IUpdateSidePaneRequest = uiEventsFrameworkInstance.requestHelper.createPublishRequest('UpdateSidePane') as IUpdateSidePaneRequest;
payload.setVisibility(true);
sidePaneContext.publish(payload).then((response: IOperationResponse) => {
console.log(response)
}).catch(() => { })
}次のコード・サンプルは、JavaScriptで、セクション表示を更新するためのサイド・ペイン操作の更新の例を示しています。
const updateSidePaneContext = async () => {
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const sidePaneContext = await uiEventsFrameworkInstance.getSidePaneContext('sidePaneId');
const payload = uiEventsFrameworkInstance.requestHelper.createPublishRequest('UpdateSidePane');
payload.setVisibility(true);
sidePaneContext.publish(payload).then((response) => {
console.log(response);
}).catch(() => { })
}setSectionId
このファンクションを使用して、すでに別のセクションIDにカスタマイズされているsidePaneに別のセクションを設定します。
setSectionId(sectionId: string): void;| パラメータ名 | 必須かどうか | 説明 |
|---|---|---|
| sectionId | はい | セクションID。 |
次のコード・サンプルは、セクションIDを更新するサイド・ペイン操作のTypescriptの例を示しています。
const updateSidePaneContext = async () => {
const uiEventsFrameworkInstance: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const sidePaneContext: ISidePaneContext = await uiEventsFrameworkInstance.getSidePaneContext('sidePaneId');
const payload:IUpdateSidePaneRequest = uiEventsFrameworkInstance.requestHelper.createPublishRequest('UpdateSidePane') as IUpdateSidePaneRequest;
payload.setSectionId('newSectionId');
sidePaneContext.publish(payload).then((response: IOperationResponse) => {
console.log(response)
}).catch(() => { })
}次のコード・サンプルは、JavaScriptで、セクションIDを更新するサイド・ペイン操作の例を示しています。
const updateSidePaneContext = async () => {
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const sidePaneContext = await uiEventsFrameworkInstance.getSidePaneContext('sidePaneId');
const payload = uiEventsFrameworkInstance.requestHelper.createPublishRequest('UpdateSidePane');
payload.setSectionId('newSectionId');
sidePaneContext.publish(payload).then((response) => {
console.log(response);
}).catch(() => { })
}setIcon
sidePaneのアイコンを設定するには、次の関数を使用します:
setIcon(icon: boolean): void;| パラメータ名 | 必須かどうか | 説明 |
|---|---|---|
| icon | はい | サイド・ペインのアイコン記号。 |
次のコード・サンプルは、サイド・ペイン操作を更新してアイコンを更新するためのTypescriptの例を示しています。
const updateSidePaneContext = async () => {
const uiEventsFrameworkInstance: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const sidePaneContext: ISidePaneContext = await uiEventsFrameworkInstance.getSidePaneContext('sidePaneId');
const payload:IUpdateSidePaneRequest = uiEventsFrameworkInstance.requestHelper.createPublishRequest('UpdateSidePane') as IUpdateSidePaneRequest;
payload.setIcon('newIcon');
sidePaneContext.publish(payload).then((response: IOperationResponse) => {
console.log(response)
}).catch(() => { })
}次のコード・サンプルは、サイド・ペイン操作を更新してアイコンを更新するためのJavaScriptの例を示しています。
const updateSidePaneContext = async () => {
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const sidePaneContext = await uiEventsFrameworkInstance.getSidePaneContext('sidePaneId');
const payload = uiEventsFrameworkInstance.requestHelper.createPublishRequest('UpdateSidePane');
payload.setIcon('newIcon');
sidePaneContext.publish(payload).then((response) => {
console.log(response);
}).catch(() => { })
}getContext
この関数を使用して、レスポンス・オブジェクトのコンテキストを取得します。
次のコード・サンプルは、getContextメソッドの構文を示しています。
getContext(): IObjectContext;次のコード・サンプルは、getContextメソッドが使用されているSaveRecord操作のTypescriptの例を示しています。
/// <reference path="uiEventsFramework.d.ts"/>
const frameworkProvider: IUiEventsFrameworkProvider =await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');
const tabContext: ITabContext = await frameworkProvider.getTabContext();
const recordContext: IRecordContext = await tabContext.getActiveRecord();
const requestObject: CX_SVC_UI_EVENTS_FRAMEWORK.IOperationRequest = frameworkProvider.requestHelper.createPublishRequest('cxEventBusSaveRecordOperation');
recordContext.publish(requestObject: IOperationRequest ).then((message: IOperationResponse) => {
const response = message as ISaveRecordResponsePayload;
console.log(response.getContext()); // usage of getContext
}).catch((error: IErrorData) => {
console.log(error.getMessage());
}); 次のコード・サンプルは、getContextメソッドが使用されているSaveRecord操作のJavaScriptの例を示しています。
const frameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');
const tabContext = await frameworkProvider.getTabContext();
const recordContext = await tabContext.getActiveRecord();
const requestObject = frameworkProvider.requestHelper.createPublishRequest('cxEventBusSaveRecordOperation');
recordContext.publish(requestObject).then((response) => {
console.log(response.getContext()); // usage of getContext
}).catch((error) => {
console.log(error.getMessage());
});