Ticket T646485
Visible to All Users

Implement this for a global key shortcut "Go To" action; using latest XAF web app

created 7 years ago

[DevExpress Support Team: CLONED FROM S18977: How do I implement a keyboard shortcuts functionality in an XAF ASP.NET applications (for example, to save detail view changes)?]
@Dennis: I'm trying to implement this for a global key shortcut "Go To" action; using latest XAF web app (which AFAIK is a SPA app); the shortchut is handled, but it seems every time i press the shorcut, the startup script is registered again, so for example, if i simply do a "window.alert()" call , every time i press, i get the double alerts than the previous call.

Any solution for that?

Cheers!

Comments (1)
Dennis Garavsky (DevExpress) 7 years ago

    Hi Franco,

    I re-tested my WebShortcutsWindowController with MainDemo.Web v18.1 and it worked fine in Chrome. I also double-checked it using the window.alert("123") call.
    Would you please attach a modified MainDemo.Web app replicating the unwanted behavior?

    What web browser did you test?

    Answers approved by DevExpress Support

    created 7 years ago (modified 7 years ago)

    Dennis,

    I've found the bug on my own code: the problem was simply I was not understanding the web app flow; my startup js script was registering the key shortcut every time (I'm using a third part library `keymaster`); simply adding a conditional on a global flag (ie:`window.shortcutsRegistered` I 've managed to fix it.
     
     Sorry about that! Cheers.

      Show previous comments (2)
      Dennis Garavsky (DevExpress) 7 years ago

        Sure, that is possible. Currently, the solution registers startup scripts when a View is changed within a Frame. Additionally, the IsSuitableView predicate is checked. If you do not need this View-dependent logic, modify the original solution code to remove this logic according to your business requirements. In the simplest case, you can override the WindowController's OnActivated method and call the RegisterStartupScript method there.

        FB FB
        Franco Bonacchi 7 years ago

          It is not working, i need 18.1.3.18148 PDB's to debug this. Where can i download?

          Dennis Garavsky (DevExpress) 7 years ago

            Hello Franco,

            Please pardon my delayed response. You can download it from here: http://downloads.devexpress.com/HotFixes/DXP/v18.1/18.1.3.18148/PDB/
            If this does not help, I would kindly ask you to demonstrate these problems using our MainDemo app by adding required custom code into it.
            In many cases, the opposite approach may help: try to remove unnecessary parts from your entire project until it becomes very simple (e.g., 1-3 objects left). Refer to the https://community.devexpress.com/blogs/ctodx/archive/2009/01/08/a-request-for-simple-example-programs.aspx article for more information.

            Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

            Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.