如何从SharePoint在线文档库中的菜单项自定义操作打开模式对话框中的提供者托管应用程序 [英] How to open Provider Hosted app in modal dialog from menu Item custom action in a document library in SharePoint online

查看:64
本文介绍了如何从SharePoint在线文档库中的菜单项自定义操作打开模式对话框中的提供者托管应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我已在线创建了提供商托管外接程序SharePoint的菜单项自定义操作。单击自定义操作后,我想在模态对话框中打开提供商托管应用程序。现在页面是在一个新的选项卡中打开而不是在模态对话框中。我的自定义操作代码看起来像下面的

I have created Menu Item custom action with Provider Hosted Add-in SharePoint online. On click of Custom action I want to open Provider Hosted app in Modal dialog. Right now page is opening in a new tab not in modal dialog.My Custom action code is looking like below.

<? xml < span style ="color:#ff0000; font-size:small"> version = " 1.0 " 编码 = " utf-8 " ?>

<?xmlversion="1.0"encoding="utf-8"?>

< 元素 xmlns = " http://schemas.microsoft.com/sharepoint/ " >

<Elementsxmlns="http://schemas.microsoft.com/sharepoint/">

 < CustomAction Id = " f44587a5-5d1f-458b-8d69-8a90ea132d38.SendToArchCustomAction "          

  <CustomActionId="f44587a5-5d1f-458b-8d69-8a90ea132d38.SendToArchCustomAction"         

RegistrationType = " 列表 "                

RegistrationType="List"               

RegistrationId = " 101 "                

RegistrationId="101"               

位置 = " EditControlBlock "                

Location="EditControlBlock"               

序列 = " 10001 "               

Sequence="10001"              

标题 = " SendToArchCustomAction & action "

Title="SendToArchCustomAction&apos;action"

HostWebDialog = " TRUE "             

HostWebDialog="TRUE"            

HostWebDialogHeight = " 250 "                

HostWebDialogWidth = " 700 " >

HostWebDialogWidth="700">

 < UrlAction Url = " remoteAppUrl / Pages / Default.aspx?{StandardTokens} & amp; DisplayType = iframe & amp; HostUrl = {HostUrl} & amp;& amp; Source = {Source} & amp; SPListItemId = {ItemId} & amp; SPListId = {ListId} & amp; amp; SPSource = {Source} & amp; amp; SPListURLDir = {ListUrlDir} & amp; amp; SPItemURL = {ItemUrl} " />

 <UrlActionUrl="~remoteAppUrl/Pages/Default.aspx?{StandardTokens}&amp;DisplayType=iframe&amp;HostUrl={HostUrl}&amp;&amp;Source={Source}&amp;SPListItemId={ItemId}&amp;SPListId={ListId}&amp;amp;SPSource={Source}&amp;amp;SPListURLDir={ListUrlDir}&amp;amp;SPItemURL={ItemUrl}"/>

 < / CustomAction >

  </CustomAction>

< / 元素 >

</Elements>

问候,

Abha Sharma

Abha Sharma

推荐答案

您好Abha,

Hi Abha,

您是否为主机Web文档库创建了菜单项自定义操作?

Did you create Menu Item custom action for Host Web document library?

在我的测试中,它工作正常。我在提供者托管的加载项中为Host Web文档库创建一个菜单项自定义操作。代码如下:

In my test, it is working fine. I create a Menu Item custom action for Host Web document library in provider hosted add-in. The code as follow:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="b7ae4c76-1c36-493b-beee-d7807e4ec6e8.SendToArchCustomAction"
                RegistrationType="List"
                RegistrationId="101"
                Location="EditControlBlock"
                Sequence="10001"
                Title="Invoke &apos;SendToArchCustomAction&apos; action"
                HostWebDialog="TRUE"
                HostWebDialogHeight="250"
                HostWebDialogWidth="700">  
                
    <!-- 
    Update the Url below to the page you want the custom action to use.
    Start the URL with the token ~remoteAppUrl if the page is in the
    associated web project, use ~appWebUrl if page is in the app project.
    -->
    <UrlAction Url="~remoteAppUrl/Pages/Default.aspx?{StandardTokens}&amp;SPListItemId={ItemId}&amp;SPListId={ListId}" />
  </CustomAction>
</Elements>

最好的问候,

丹尼斯


这篇关于如何从SharePoint在线文档库中的菜单项自定义操作打开模式对话框中的提供者托管应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆