Open document in new tab from xPages viewpanel?

99封情书 提交于 2019-12-24 03:06:09

问题


Is there any way to open the document in a new browser tab when the link in a view panel is clicked?


回答1:


You have two options. one is the way that Tim explained. And another, you can compute the view column value as link. There you can use the _new or _blank property.

Simply say, View Column can be given as a HTML. There you can compute the page with html href tag.




回答2:


"target" is one of the properties of the view panel component. If you specify "_blank" (as Ferry suggested) as the value of that property, it should apply it to the link for each row. But bear in mind, you're ultimately at the mercy of the end user's browser settings. One user may get a new tab, another may get an entirely new window, and yet another might get nothing because the link was treated as a popup and blocked.




回答3:


This is a browser setting only. You only have to put target="_blank" in the link.




回答4:


After trying this I decided against using it for a number of reasons but want to post the procedure below to implement it.

On the view column Display tab select computed value and enter a formula as follows:

 var _row:NotesXspViewEntry = viewEntry; 

 var _unid = _row.getUniversalID(); 

 return "<a href='0/" + _unid + "?OpenDocument'  TARGET='_new'>" +  _row.getColumnValue("RequestNum") + "</a>"  

On the Display Tab select HTML.




回答5:


Just adding another option to the mix. If you set Column Display as 'hidden' you can then put a standard link control in the column. E.g. if the desired column link text was a 'First Name' column, which opened a new tab to the page 'Person.xsp'

<xp:viewColumn columnName="firstName" id="vcFirstNameCol" displayAs="hidden">

    <xp:viewColumnHeader value="First Name" id="vchFirstName"></xp:viewColumnHeader>

    <xp:link escape="true" text="#{javascript: rowData.getColumnValue('firstName');}" id="link1" value="Person.xsp"
            target="_blank">
        <xp:this.parameters>
            <xp:parameter name="documentId" value="#{javascript:rowData.getUniversalID();}"></xp:parameter>
            <xp:parameter name="action" value="openDocument"></xp:parameter>
        </xp:this.parameters>
    </xp:link>

</xp:viewColumn>


来源:https://stackoverflow.com/questions/10853134/open-document-in-new-tab-from-xpages-viewpanel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!