The Fileselector component as it is is limited to selecting only files and returning their fileid. Let us modifiy it to also select folders if needed.
To expand, we will pass in another boolean parameter called "selectDatasetsorFolder", when this is true, the viewer will display files but will have the capability to only select folders or datasetst