open blank page (new page) on clicking calculated page url in a view

后端 未结 2 1112
醉话见心
醉话见心 2021-01-27 01:47

I\'ve got following viewPanel. I would like to open a new page when the users clicks on the calculated page url. I just don\'t seem to figure this out.



        
相关标签:
2条回答
  • 2021-01-27 02:48

    Some time back I was grappling with same issue. I created a workaround for it which works, but I don't know if it is the best way to go about it.

    First set the displayAs attribute of xp:viewColumn to hidden. So it looks something like this:

    <xp:viewColumn columnName="picDescr" id="viewColumn9" displayAs="hidden" openDocAsReadonly="true">
    

    Now put a Link control in the column, you would have to do this in Source tab. You can then set the target attribute to _blank for the Link control. So your code would look something like this:

    <xp:viewColumn columnName="picDescr" id="viewColumn9" displayAs="hidden" openDocAsReadonly="true">
        <xp:link escape="true" target="_blank">
            <xp:this.text><![CDATA[#{javascript:rowData.getColumnValue("picDescr");}]]></xp:this.text>
            <xp:this.value><![CDATA[#{javascript:thisid = rowData.getColumnValue("unid");
    thisdocument = rowData.getColumnValue("picName");
    picturename = thisdocument.replace("th_","");
    calculatedlink = "servername/product/picture.nsf/O/"+thisid+"/$FILE/"+picturename;
    return calculatedlink}]]></xp:this.value>
        </xp:link>
    ...
    ...
    ...
    </xp:viewColumn>
    
    0 讨论(0)
  • 2021-01-27 02:53

    I think I would use a repeat control instead.

    Up near the top establish the linkage to the data as you did:

    <xp:this.data>
        <xp:dominoView var="contactsView"
            viewName="TeamDirectoryNameLU">
        </xp:dominoView>
    </xp:this.data>
    

    and then, where you want your "view":

    <ul>
        <xp:repeat id="contactRepeat" rows="30" value="#{contactsView}" var="dataRow" disableOutputTag="true">
            <li>
                <xp:link escape="true" id="link1">
                    <xp:this.value><![CDATA[#{javascript:return "m_ContactDetails.xsp?action=OpenDocument&documentId=" + dataRow.getDocument().getUniversalID();}]]></xp:this.value>
                    <xp:this.text><![CDATA[#{javascript:return dataRow.getColumnValue("Name");}]]></xp:this.text>
                </xp:link>
            </li>
        </xp:repeat>
    </ul>
    

    I got the basics of that from TeamStudio in their recent video on mobile apps. It's part of a jQuery-powered contacts list that opens the contact details XPage for the contact you click on.

    0 讨论(0)
提交回复
热议问题