Sample app File Window does not close result window: typo

Started by ubacher, June 09, 2017, 03:29:48 PM

Previous topic - Next topic

ubacher

See screen shot:
response.instanceId is written  ...instanceid  (lowercase i)

I have not tried ESlint to see if it would have picked this up.


If I place 'use strict' it complains:
SyntaxError: protected is a reserved identifier


Mario

Thanks. Fixed already. Also renamed protected parameter which is a reserved word in ES6.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

Same app: clicking on a file Id (in the list of the first 20 files) should select this file.
If I click on the 20th id the list then the 20th file in the window should also be selected.

It does not. Some other file is selected. It seems the list of files in the file window is not sorted correctly.

Mario

The file is selected by it's unique id so this cannot be wrong.
The sample app does not sort the files in any particular way. If you have more than 20 files, it just cuts off.
The file id is displayed before each link. Configure a file window layout to show the OID (decimal). Are the numbers identical?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

How does one get a list of files in the same order as in the file window (same sorting order)?
In the file window app the files are listed in numeric order.

Mario

If you access the selection via the corresponding idlist, the idlist contains the files in the same order as the file window.
You should be able to see this by selecting all files int the file window while the file window sample app is open. When you change the sort profile in the file window, the idlist will change and so will the list in the app.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

I am talking about the sample app File Windows: It says it lists the first 20 files in the file window
but the files shown are some other files and listed in OID order.

Screenshot attached.

PS: In some folders I had it display correctly. Is that some consequence of the asynchronous reply?

Mario

I could not reproduce this. I always see the files in the same order as they are in the folder.
This idlist is filled directly from the file window.

Show me an example where you get a different order.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

Quote
Show me an example where you get a different order.

Shown in the screen shot.

Mario

Ah, this. I thought you were talking about the selected files.

For this, the script uses the /files endpoint.
The /files endpoint does not return the files in a specific order, unless you specify a sort profile.

Maybe I should change the filewindow*idlists to automatically sort the returned ids by the sort profile currently selected in the file window. Same for the .total idlist.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

In the documentation it says:
Quotesortprofile   Name of the sort profile to apply to the set of files. If this parameter is not specified, the default sort profile is used to sort the result.

(Where I am not sure what default means: the sort order by this name or the currently selected sort order.
I suppose returning the currently selected sort order would be the most common use.)

So this should be a BUG report rather than requiring a feature request.

Mario

I have already changed the idlists.
Please open a bug report for the other thing to I can schedule time.
If an idlist is specified, /files does not apply a sort profile. idlists have their own sort order! I see no bug, maybe a missing documentation item.
I shall add ". If an idlist is specified, the order of the returned files is controlled by the sort order of the idlist." to the documentation for the next release.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook