chooseFolder JS code changed to the new implementation.
All parameters passed between JS/Java are strings.