This was brought to our attention from one of our respected and beloved collegues, Steve Abrahamson of Ascending Technologies.
I thought we would recap here on our blog for those wanting to know the issue and the resolution. You can find here as well on the FBA List.
– THE ISSUE –
So I went to implement a little drag and drop sorting goodness in a solution tonight. A while ago I downloaded a demo from Exelisys on drag & drop sorting, so I fired that up and went to put it in… and it doesn’t work with TSM.
I got it here: http://www.excelisys.com/tips-tricks-filemaker-downloads.php
You see, the technique relies on an Auto-Calc field evaluating during a script execution and setting some $$variables. Unfortunately, with TSM, that data field is in a different file, and hence, the $$variables are not visible to the script during execution.
Took me a good 45 minutes to realize that, of course. *sigh*
Does anyone know a good drag & drop portal sorting technique that WILL work in TSM?
– THE SOLUTION OFFERED BY EXCELISYS–
Easy modification:
1. Create unstored calcs in the other file that reference those global variables
2. In the interface file, reference the unstored calcs instead of the global variables
– ADDITIONAL TWEAK INFO VIA STEVE –
Thanks! It does work; note that it requires one more modification: an extra script in the data file to be called at the end, to clear out the $$variables there
The only real *problem* is this: there’s a 2-3 second lag with this, which feels just short of forever… and that’s running locally on my development machine. I’m not sure what performance will be like in production, but it won’t be faster than that. (Andrew’s original file executes instantaneously, which is great.)
Conceptually, the original technique is great for FMP, though oppositional to TSM: it requires the addition of 2 extra TOs in the data file for every place where you want to implement this UI feature; the idea of TSM is to have this detritus in the UI file, so conceptually, it rankles. It’s untidy. That’s just me being anal.
I was trying to make a version that, instead of relying on an auto-evaluate field, rather uses two triggers, one on field entry, one on field modification, plus one OnTimer call. It’s a bigger script by a long shot, but was hoping it’d be cleaner in execution, and all script, no field-level stuff. As it is, I need to get going on this project, and since this works (awkwardly, but works), this may get tabled for now.
Please extend my thanks to your guys for the assist. I’ll put a happy response up on FBA Tech Talk. Everybody likes happy, don’t they? Especially when it ends that way.