One of the common requirements with Data Standard is to pick the right folder. In a previous post I’ve shown how this can be done with two or more cascading combo-boxes, where each combo points to a folder-level inside Vault. With this post I’d like to show you another way of picking a folder. A while ago, we posted on a tool that we call folderPicker.
It’s a dialog that lists a tree of objects, where the user can navigate through and pick one. The resulting path is returned and can be used. Based on customer feedback, the folderPicker holds a history of recently selected paths and a list of favorites, so that re-picking similar or frequently used objects becomes easy. I deliberately say objects and not folders, as the folderPicker in realty can display any type of objects-tree. For instance, you could display BOMs, pick an item and get the path of such selection, or any other hierarchically managed object.
Anyway, we talk about folders today. But, as you know, each customer project might have particular requirements. One customer has a complete free path, another one has a fixed initial path and then a free one, the next one would like to pick just from certain folder types, such as project or other categories, and so on. So, the folder picker must be flexible in terms of his root folder and filter criteria for the child elements.
The folderPicker is an assembly you can easily load into your Data Standard project and bind for instance a button with it. As the customer hits the button, the folderPicker dialog appears. The function behind the button calls the folderPicker and the resulting value is stored in a field that can be used for creating the path. The method Show requires as arguments the root folder, so that you can choose where the tree of the folderPicker shall start, and you can pass a title and full path in case you like that the folderPicker should already expand that path in the tree.
In order to find and display the children for the given root element, an according logic must be implemented. In the package provided with this post, the logic for finding child folders is already implemented. However, in case you like to influence the finding logic, you have to adapt the function GetChildren. This way, you may display only folders of certain categories, names, or other properties.
All right, with the coolOrange folderPicker you have a now a very elegant and flexible instrument for picking a folder, either from your local disk, or Vault. We published on the source code on GitHub, so that if you like to better understand how it works, or you like to tweak the folderPicker, you are free to do it.