SharePoint/sp-dev-docs

ListViewCommandSet (spfx) does not work with ListView webpart on modern page

Closed this issue · 13 comments

Category

  • [x ] Bug

Expected or Desired Behavior

I excpect an extension of type ListViewCommandSet to display my commands on a modern page with the ListView(preview) webpart added.

Observed Behavior

The ListView(preview) webpart displays the CustomAction Title in the commandbar and the button is not actionable.

Steps to Reproduce

Create a new project with yo
Add a custom extension
Run the gulp commands for bundle and package-solution
gulp bundle --ship
gulp package-solution --ship

Deploy the package to appcatalog and approve the app.
Add the app to any modern site.
Add a list to the start page of the modern site.
Now the command bar appears with a new command with the title of the CustomAction from the elements.xml file

elements.xml file:
<?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction Title="HelloWorld" RegistrationId="100" RegistrationType="List" Location="ClientSideExtension.ListViewCommandSet.CommandBar" ClientSideComponentId="5e4d1a86-8ced-4c69-ae64-9a8651db946e" ClientSideComponentProperties="{&quot;sampleTextOne&quot;:&quot;One item is selected in the list.&quot;, &quot;sampleTextTwo&quot;:&quot;This command is always visible.&quot;}"> </CustomAction> </Elements>

Image of startpage with ListView webpart:
image

Note that the Commandbar works as excpected if you navigate to the list.
Image of list:
image

Yes, sharing is caring.

I concur that this is a bug where the ECB custom action for lists/libraries works in the list/library view, but not in the list/library (preview) webpart. It appears that the custom action title value from the spfx solution sharepoint/assets/elements.xml shows in the webpart, but the command title value from the src/extensions/{solution}/{solution}.manifest.json is being displayed in the list/library view. Solution code is not being fetched in aspx pages that contain the list/library view webpart outside of a list/library view page. So what this means is that if you have a custom action with custom code that is triggered by the command then nothing will happen inside of a list/library view webpart. It simply deploys a dead link. Seems that this customization ability is half baked.

I can confirm this is not working. What is the planning of resolving this? So we can communicate about it. Thanks!

Similar as #2684. Routed to the right people. No ETA for fix currently. The issue is in the implementation of oob web parts.

@VesaJuvonen Has #2105 also been routed to the right people? It seems like a similar matter but hasn't had any updates since June.

I have the exact same issue on my side, the icon is missing from the button, the label isn't the correct title specified in the manifest and the code associated with the button isn't working.

This seams to be solved now, at least in our tenant. Feel free to close.

Hello,

My CommandSet "Command Bar" show only the Title from the elements.xml since 1 week :/

elements.xml :

<?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction Title="UserInfo" Location="ClientSideExtension.ApplicationCustomizer" ClientSideComponentId="b74aa2eb-c7e5-43d0-97e9-0bba2116b3ed" ClientSideComponentProperties="{&quot;testMessage&quot;:&quot;Test message&quot;}"> </CustomAction> <CustomAction Title="revPrice" RegistrationId="101" RegistrationType="List" Location="ClientSideExtension.ListViewCommandSet.CommandBar" ClientSideComponentId="e8b3de2f-3db7-4556-bdfa-56e2ce3c61c3" ClientSideComponentProperties="{&quot;sampleTextOne&quot;:&quot;One item is selected in the list.&quot;, &quot;sampleTextTwo&quot;:&quot;This command is always visible.&quot;}"> </CustomAction> </Elements>

image

Do you know if I'm missing something ?

Not working in our corporate tenant. Only works on actual list view page, not on any site page

Now the button is completly missing from a modern page with the ListView webpart. When the user opens the library the button works properly. We have this issue on several tenants. Note also that the PowerApps button is missing on the home page but displays in the library.

Image with missing button from modern home page.
image

Image with working button in library.
image

Same here. Our button suddenly disappeared . Our extension logs to the console in the onInit(), and we don't see that log message either. Seems like the extension isn't loaded or at least not activated. It is visible in the list but not in the 'List' part.

@magnusdanielson @TazzyMan - could you please check if the issue is still there?
Seems like issue with title was a regression bug that is currently fixed.

Please, let me know if you still can repro it on your tenants.

Thanks!

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within the next 7 days of this comment. Please see our wiki for more information: Issue List Labels: Needs Author Feedback & Issue List: No response from the original issue author

Closing issue due to no response from the original author. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: No response from the original issue author