Domanda

I am trying to make a SharePoint add-in work with the SharePoint Online "new experience". It adds a custom menu item custom action that runs inside iframe (HostWebDialog="true") and works well with SharePoint 2013:

<CustomAction Id="1237b974-6d89-4d20-b8ac-2b4ba8e21dce.MenuTest1"
                RegistrationType="List"
                RegistrationId="101"
                Location="EditControlBlock"
                Sequence="1"
                Title="Menu text"
                HostWebDialog="true"
                HostWebDialogHeight="280"
                HostWebDialogWidth="400">

    <UrlAction Url="~appWebUrl/Pages/MyPage.aspx?{StandardTokens}&amp;SPListItemId={ItemId}&amp;SPListId={ListId}&amp;SPSource={Source}&amp;SPListURLDir={ListUrlDir}&amp;SPItemURL={ItemUrl}" />
  </CustomAction>

However with the "new experience" it does not work. No JS errors or any messages are displayed, the menu call is silently ignored.

Does the "new experience" support HostWebDialog="true" option?

È stato utile?

Soluzione

According to Update on Modern Document Libraries and Extensibility they should work.

We’ve already made some good progress here. Theming, global navigation links, and URL-based custom actions that extend the ribbon and context menus are already supported in the modern document library experience. This ensures that customers and partners taking advantage of these features can use the modern document library experience without compromising their customizations.

A couple weeks ago I tried to create an app with custom actions for a modern document library and I got the same results you did - they didn't work. I Googled for a while but I didn't find any solution to the problem.

Update (Aug 1, 2016): I tried again today and I was able to get both types of custom actions (menu item and ribbon) working against a document library using the new experience. I wasn't able to get the target page to show in a dialog.

Update 2 (Aug 1, 2016): I've been on an email thread with people from Microsoft and they have confirmed that opening the target page in a dialog is not supported in the new experience.

Altri suggerimenti

If you set the dialog parameters in your custom action , it will be translated into Javascript:LaunchApp(url, dialogoptions) with the new experience if the dialog options is not null it simply won't work and will cause a javascript error.

You should remove the dialog options and the url will open in a new window.

see full details on how custom actions works with the new doclib experience below:

http://www.sharepointtweaks.com/2016/07/new-document-library-experience-part-ii.html

Amr

Update 1 Aug after the 5th release of the odspo-next now the dialog opens in a new window and no javascript error is thrown

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top