locked
LightSwitch HTML 5 VS 2013 - HTML screen stops responding when 2 promise statement calls overlap causing both calls to never complete. RRS feed

  • Question

  • I am working in Visual Studio 2013 LightSwitch HTML on Windows 7 Ultimate.

    I am having an issue with a certain scenario that is causing the application to stop working requiring a browser refresh to continue using the application.

    The screen has a keypress event listener applied when the screen is loaded that is used to capture a predefined keypress order to accept barcode scans from a blue tooth scanner.  If the scenario is met, the system will send a server request to a generic handler. The generic handler is being used as a replacement for the LightSwitch OOB methods due to performance.  The call contains the LightSwitch msls.showProgress() and msls.promiseOperation() functions to make an AJAX call to the generic handler.

    The keypress listener can occur at anytime while the user is on this screen. 

    The following scenario consistently causes the issue:

    The user interacts with a list and completes a function using a button execute on the screen.  Once the function completes, it will send a refresh of the list query to refresh the list for the user.  The list takes between 1-5 seconds to complete depending on resource availability.  While the list is in the process of finishing the refresh and rendor, the user scans a barcode with the bluetooth scanner causing the keypress listener to send a request to the server.  Now, there are 2 showProgress and promiseOperations running at the same time.  While watching the browser console, I notice there are multiple paging calls being made only when this scenario occurs.  If the user performs an action that refreshes the list again while this occurs, the paging calls and the refresh call never complete causing the screen to stay in waiting mode and never finish.  The only way to continue is to refresh the browser and access the application to continue where the last failure occurred.  The paging calls should not occur because I have set the number records to fill the area so paging should not be called initially and during refresh, but consistently, this scenario is firing paging requests.

    How can we manage the keypress event to not send the server request until the list load is complete?

    Any help with this issue would be appreciated and thank you for your time.


    Best regards, Chris

    Friday, March 14, 2014 4:29 PM

Answers