FileManager NewValue

  1. 5 years ago

    doobox

    8 Jul 2018 User since 2018

    I'm not 100% sure my expectation the value parameter of the NewValue event of the FileManager is correct, but...

    I expected the value parameter to contain info about each file the FileManager collects from its data source (Assets in this case).
    I expected to be able to access info like this for example:

    self.test.push(value.path)

    To get an array of paths to all the files FileManager collects from Assets.
    But value always yields null (see attached)

  2. marco

    9 Jul 2018 Administrator User since 2016

    Hi @doobox you are right, documentation is not clear about this point.
    In the FileManager case the NewValue event is sent at the end of the processing (the overhead would be too high if the event is sent for each processed file/folder). In this particular case the NewValue event is similar to the DidEvent event. We'll probably improve this behaviour in a future release.

  3. doobox

    9 Jul 2018 User since 2018
    Edited 5 years ago by doobox

    @Marco Thanks. So is there a case where the "value" parameter in FileManagers NewValue event would ever be anything other than null at the moment?

    Also.. Note in my screenshot above, two files present in Assets (where FileManager is looking), and two hits on the NewValue event (as noted in console). Does this not mean the NewValue event is actually firing once for each file? Perhaps you intentionally skipped the processing of each file in the event, but the event still fires once for each file.

  4. marco

    9 Jul 2018 Administrator User since 2016

    @doobox at the moment ONLY null value is passed as parameter of the NewValue FileManager event.

    If you try to run the FileManager example located at https://docs.creolabs.com/tutorials/file-manager.html you'll see that the event is fired only twice (even if the items are 5), so I can confirm that for performance reason that event is not called for each processed object.

or Sign Up to reply!