-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't apply field customizer to Name columns in form libraries #906
Comments
Form library is not enabled for modern library experience yet. Client-side extensions only work for modern library UX. |
@ahackettms Thank you for your response. It's possible I am misunderstanding what you said, but I am definitely seeing form libraries in the modern UX and am able to apply field customizers to columns there except the columns that this case is about. I'm glad to hear that it sounds like there are some changes still in the works, though. |
It seems like form libraries usually display in the clasic view by default, but it's definitely possible to view them in the modern UX on SharePoint Online. The following seems to work for getting a form library to show in the modern UX.
After doing that, the library shows up in the modern UX (at least it does for me). Regarding the issue I am reporting, here are repro steps: Repro steps: Attempting to modify form library columns' ClientSideComponentId and ClientSideComponentProperties and apply an installed field customizer to those columns
SummaryThe above steps demonstrate the following:
It's also possible to observe a similar issue when trying the extension in Debug mode. Even in Debug mode, which circumvents the inability to modify the ComponentId and ComponentProperties on these columns, it's still not possible to appply a field customizer to any of the Name columns. Here are the steps for that: Repro steps: Attempting to apply a field customizer to form library columns in debug mode
|
Hi @ahackettms any word about this? I have just tried again and it looks like it's still not possible to apply a field customer to the built-in Name column of Form Libraries. I would really like to know what the situation is because MS is pushing the Modern UX out to SPO environments and it will become increasingly difficult for my customers to use JSLink. |
After a bit more investigation, it looks like I am able to apply a field customizer on the FileLeafRef column, and these changes are also reflected across all of the other name columns. I've also verified that I can use the REST API to set the ClientSideComponentId and ClientSideComponentProperties on this column. So I think I may be squared away now. I will continue experimenting with this functionality. |
@JLRishe I'm trying to apply a field customizer to FileLeafRef. Works fine in debug, but feature activation won't set the guid. Also, if I set the guid manually it still won't load. Could you provide steps as to how you got it working? Package settings and how you apply the id. |
@wobba Can you clarify what you mean by "manually" when you say "if I set the guid manually"? I haven't used the feature framework for this. I've had success setting the ClientSideComponentId and ClientSideComponentProperties using the REST API and have found that the field customizer works as expected when I do so. I have a gist (also mentioned further up above) with some example code showing how to use the REST API to set these properties. I've also had success using the SPHttpClient to do so from within a webpart. I haven't done anything out of the ordinary with the package settings. Basically just the defaults. Some questions:
|
@JLRishe by manually I meant PowerShell. Are you using a global extension without feature activation? Or do youadd the app to the site? And then modify for example And appreciate the help :) |
@wobba As of right now, I've been adding the app to individual sites and using REST to modify the properties on individual library fields. I hope you manage to get it working! |
Ok..so add per site but without the feature.xml right? |
@wobba Yes, that's what I mean. I don't have a feature.xml and my elements.xml just contains an empty |
@JLRishe Ok, so it works for |
@wobba That's very odd. Modifying FileLeafRef's properties and applying the field customer that way has been working for me for a few months now. I assume you're using SharePoint Online? Not on-premises? |
On-line yes. Tried in Doc lib and Site Pages. Could you try to create a sample sppkg which works on FileLeafRef and share it? |
@JLRishe Also, which SPFx version are you using? I'm testing with v1.5.1. |
@wobba Not sure where I would find the version number for that. Where should I look? Looks like I'm using v 1.4.1 of the @microsoft/sp-core-library. I'll try to put together a sample sppkg tomorrow. |
Seems 1.4.1 then :-) and thank you. |
@wobba I think I've just made a discovery that might explain why you're having trouble. In Debug mode, it seems that you have to indicate FileLeafRef as the column name and that overrides all three Name columns with the field customizer, but outside of Debug mode, the field customizer is applied to the column(s) that actually have its GUID in their properties. Since the FileLeafRef column is not included in library views by default (LinkFilename is the Name column that's included by default), this might explain why you don't see anything happening. Could you try displaying all three Name columns in your view at once, and see if the field customizer is being applied to any of them? If that works, it may make sense to apply the Component Id and Properties to all 3 Name columns when configuring them. |
@JLRishe I'm sure I tested this yesterday as well.. but seems it works fine with |
Hi @JLRishe and @wobba I appreciate any hint Thanks |
@ralftokada see my post with link to code: |
@wobba Although for my solution, I just need to customize the file link of any default view so it will launch an specific file type with a client installed app I will provide. without modifying any other feature. Sound simple but It has turn out to be quite a challenge. Thanks again |
True.... would be nice to append to default behavior. You can always do DOM manipulation and hope it works forever ;) |
@wobba In you solution, is it possible for the DocIcon to render the default value instead of rendering the default into aspx file? (e.g: folders, word, word docs being checked out)? Sorry if the question is a bit out of scope, but I'm trying to improvise your solution to manipulate the Name field for another purpose using the DocIcon method, however it seems that it is not possible to not rendering the default innerHTML value. If it's not possible, I might raise a feature request to render default value if not matching certain conditions.
|
@jonathanhotono you cannot fallback to default, but have to implement logic yourself for the right icon. So getting support for default fallback would be ideal indeed. |
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues |
Category
Expected or Desired Behavior
I am trying to apply a field customizer to any one of the name columns in a form library (form libraries have three Name columns, with internal names FileLeafRef, LinkFilename, and LinkFileNameNoMenu)
If this is not possible, I would like to create a column that "shadows" one of these columns, by referencing their values so I can apply a field customizer to that column (as detailed below, I can't find a way to do this either).
Observed Behavior
I am not able to apply a field customizer to any of these three columns. If I try to run an extension in debug mode by using the loadSPFX, debugManifestsFile, and fieldCustomizers. parameters in the URL, my field customizer's code does not run and the column's rendered content is unchanged.
If I try to use the REST API to set any of these columns' ClientSideComponentId, the REST request returns a 204 success result, but the columns' ClientSideComponentId value remains unchanged as 00000000-0000-0000-0000-000000000000. I am able to use the same type of REST request to change the ClientSideComponentId on other columns, but not these.
I am unable to find a way to create a column to "Shadow" any of these column. It seems that it's not possible to create a Calculated column that references an item's filename since File columns cannot be used in the formulas for Calculated columns.
I know it's possible to simply create an empty column and have the field customizer render the desired value in that column, but there are two fairly large issues with this:
(1) I'm unable to sort on this column, because the underlying value is empty
(2) the column displays as too narrow, with the values truncated, because the underlying value is empty.
Steps to Reproduce
?loadSPFX=true&debugManifestsFile=https://localhost:4321/temp/manifests.js&fieldCustomizers={"LinkFilename":{"id":"[id]","properties":{}}}
The text was updated successfully, but these errors were encountered: