I have run into a bit of a tricky issue and I am trying to understand what's going on. I have a perspective view consisting of 3 tables. Each table has less than 10 rows in it. I have a custom property on the view that queries a DB for the active selection and then a few scripts that set the selected rows of the table accordingly. The issue im having is that my scripts and debug logger say the selected row is set correctly but the webpage is missing the selection every now and again. Just looking to see if anyone has run into something similar and or if this is bigger than my scripts.
Yes, there are horrible races due the fact that the browser is actually responsible for making row (and column) selection "stick". With any conflicting messages passing in the night (opposite direction), you don't know which will win.
Some users here claim this stuff is rock solid.
Consider using Ben Mussom's modules to perform the row selection on the browser side.
It certainly is not. Just this morning I had to fix a bug that had caused row selection to fail because I had forgotten that you can't deselect a row by turning off row selection (thereby triggering a change script that turns it back on) unless there's a row that's actually selected.
I'm wondering if the OP's case is related to the lack of an onLoad event handler that could be used to ensure that the table is fully loaded before attempting to set a selection...
I believe that I will have to try the browser side selection as I have a button that has the enable tied to the bool set by the table.selection.selectedRow value being the same as the query tag and the button shows up correct every time. As stated above the logger also shows that the data is set correctly its just the browser side that is failing.
As for the how the binding works, I will do my best to lay it out.
View –> On Startup Event –> Establish a listener async script with a 5 second timeout.
Async script checks for
- SQL query bound tag to have non null values.
- Non null table data
- Extracts the current row that should be selected based on the bound tag data matching on ID.
- Check if bound tag and table.selection.selectedRow agree with one another.
- If they agree return otherwise set the table.selection.selectedRow value to the correct row and wait 0.25s and try matching them again.
Debugger shows we are matching the selection in the DB and the cancel button is showing disabled as it should when we match but the table just doesn’t highlight the correct rows. I have tried to troubleshoot in a browser and as @pturmel indicated it just looks like the browser isn’t updating the selection as the HTML doesn’t contain the correct node for a selected table when it glitches.
Any quick examples of which module and how you would send that hook? I see the Embr module but not 100% sure how you would attach a selection listener.
After looking into them I agree that I am missing out for sure. I am in the process of leaving my current employer and starting my own integration business so I should then have some more time to play and be able to add things to a non-production environment. I love the preloading views that is super cool as I have several views that show live product data going down our line and pre-loading could make the user interface a lot more responsive.