Dear support team,
I want to Get ID of current folder, but when I add action "Sign All", i have error when click "Sign All" button like this

Please show me how to get ID current folder when click action.
- ABP Framework version: v4.2.2
- UI type: Angular
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
- Steps to reproduce the issue:
2 Answer(s)
-
0
Hello,
Let's talk about the hierarchy of
FileManagementModulecomponents.The root component is
FileManagementComponentwhich containsabp-page,file-management-buttons,file-management-directory-tree,file-management-folder-panel.FileManagementFolderContentComponentlies withinfile-management-folder-paneland many more.So, the component tree looks like the following:
FileManagementComponentPageComponentFileManagementButtonsComponentFileManagementDirectoryTreeComponentFileManagementFolderPanelComponentFileManagementFolderContentComponent
Now, let's look at your problem. The action you provided is being used in
FileManagementComponentand passed to thePageComponentwhich means at that level, you can only injectPageComponentorFileManagementComponent. Other components are stored in lower level of the tree and not available to you.To get the content of the current folder, here is what you can do
{ text: 'FileManagement::Sign All', action: (data) => { const component = data.getInjected(FileManagementComponent); const navigator = data.getInjected(NavigatorService); // component.currentContent => holds the list of current content, files & folders // navigator.getCurrentFolderId() => returns ID of the current folder, null if it is the root folder } } -
0
Thanks bunyamin ,
Your answer is very clear.