I am curious if there is an error message in the Console, or if the AJAX request which populates the files list is encountering problems. To diagnose this would you please post screenshots of this app with Firefox’s developer tools open to the Console? To get the best diagnostic information please:
Navigate to the page
Open the Console tab
Ensure that the Console tab is set to show:
Errors, Warnings, Logs, Info, Debug
Reload / refresh the page
Expand the XHR GET request by clicking on the triangle on the left side of the page
Take the screen shot
For reference I am looking for something like this:
@jms27000 I see that you got a 401 Unauthorized response from Apache. I have looked into how I am performing the request to list the contents of the directory, and have learned that older versions of Firefox (version < 61) have different defaults for the API I am using. I have uploaded a pre-release for you to test that corrects that oversight: https://github.com/OSC/bc_js_filepicker/releases/tag/v0.0.2.
This should correct the error you are seeing where the directory’s contents never finish loading. As for file selection: once the list on the right is populated the user would then left click on a file or directory to select a target and then click the Select button. That will close the modal dialog and set the value of the input to the selected file path. Double clicking on a directory navigates into that directory.
That’s a good idea. I’ll add it, currently it defaults to the first entry in your “Favorites”. One thing to be aware is that Batch Connect applications save their context so they will remember the last submitted value, and I do not have an easy way to always return to an original directory.
By setting a value attribute for your inputs you can set a default value. I made a number of other improvements while I was working on this including adding filtering which should come in handy for large directories. Please let me know if you find any bugs.
i have tested the file-picker. it works fine ! i have found one situation which makes problem : when the value is not set in the form.yml.erb, the filepicker shows the / tree by default. i suggest to show the homedir by default
some addings if possible :
add an argument to indicate a file or a directory target to integrate in the form parameters
according to this option, the button text will change to “File Select” or “Dir Select”
this adding will avoid to test the existence of the file choosen and its type (file or the directory) in the submit.yum.erb file
question : do you plan to integrate this file-picker function in the next OOD release ?
That is odd that it was defaulting to showing you the root directory, when used as a Batch Connect component it is intended to default to the home directory. In which version are you seeing this behavior?
If I have time I’ll look into adding an option that will only permit selecting files or directory, or files with certain extensions this coming Tuesday (I allocate Tuesdays and Thursdays for answering community questions).
As for whether the file picker will be integrated into the next major release of OnDemand: yes, I think that it or something very like it will be.