2012-09-21 27 views
0

我已經修改了網頁訪問表單的內容,顯示xPage屬性,並嘗試在運行時使用與doucments表單選項關聯的xPage打開選定的文檔,但這不起作用。當前的數據庫添加在網址的開頭:如何在視圖中打開另一個應用程序中的文檔

http://localhost/Requ%C3%AAtes852.nsf/%24%24OpenDominoDocument.xsp?databaseName=CN=Jocelyn%20Smith/OU=CSSS%20IUGS/OU=Reg05/O=SSSS!!iugs%5Cphysiosad.nsf&documentId=08FF9DFFD10070F585257A7F0053C282&action=editDocument 

我必須缺少一些非常基本的東西。有沒有人有工作?謝謝

+0

不知道你在這裏所提供的整體方案。你是否從另一個應用程序打開了一個視圖?或者你在這裏使用嵌入視圖? –

+0

在應用程序A中,我有一個簡單的視圖,其數據源是來自應用程序B的視圖。這很好。但是當我點擊鏈接打開一個文檔時,URL在開始時包含應用程序A的地址。謝謝 – user1339222

回答

0

我找到了解決方法,使用重定向頁面從URL參數中讀取文檔ID和數據庫名稱,然後重定向。儘管如此,我仍然有興趣改進這個解決方案。

<?xml version="1.0" encoding="UTF-8"?> 
<xp:view 
xmlns:xp="http://www.ibm.com/xsp/core" 
rendered="false" 
viewState="nostate"> 
<xp:this.afterPageLoad><![CDATA[#{javascript://Redirects to a page in another application 

var docid = param.documentId; 
var paramdbname = param.databaseName; 
var hostname = context.getUrl().getHost(); 

//Get dbName without host 
start = paramdbname.indexOf('!!'); 
dbName = paramdbname.slice(start+2); 

var redirectstring = 'http://'+hostname+'/'+dbName+'/%24%24OpenDominoDocument.xsp?documentId='+docid+'&action=editDocument'; 

try{ 

facesContext.getExternalContext().redirect(redirectstring); 
} 
catch(err) 
{ 
//Handle errors here 
}}]]></xp:this.afterPageLoad> 
    <xp:br></xp:br> 
Redirects to a page in another application 

相關問題