Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Warning that Modal Windows are not truly modal, and Panels have this issue too.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Warning that Modal Windows are not truly modal, and Panels have this issue too.

    I want to make you aware that the way Alpha Anywhere generates a modal form is not truly modal. A user with a keyboard can easily Tab out of the form and activate controls on the underlying page. This problem is not unique to the way Alpha creates modal windows, as you can see with this CSS/JS example from w3schools.com.

    There is a similar issue when using panels. A user can tab through the controls on the active panel and continue into panels that are not currently visible to the user. A user who has lost sight of the cursor, or who thinks they are active in another application could overwrite data or activate buttons without visibility to the changes. They may be able to access parts of your application they are not supposed to. Imagine the possibilities: Delete, Clear, Disable, Change Status, Print, Send Ballistic Missile Alert, etc.

    I created a video so you can see what I'm talking about.




    Is this important? Do you want your application to be "Accessible"? Do your users use the tab key? As a developer are you responsible to prevent user pitfalls that may impact data integrity?

    The W3C recommendation for Access Rich Internet Application (WAI-ARIA) 1.1 provides some guidelines for an accessible modal dialog:
    1. On Dialog Open, Set Focus to the first focusable element
    2. On Dialog Close, Return Focus to the Last Focused Element
    3. While Open, Prevent Mouse Clicks Outside the Dialog
    4. While Open, Prevent Tabbing to Outside the Dialog
    5. While Open, Allow the ESC Key to Close the Dialog


    There are ways via code to capture the tab key to keep the focus in the window. Do you want to write that code for every window? Do you have the skills to write the code and avoid creating side effects? I think it would be great if the RAD tool would handle that for me. The best solution can come from Alpha. This way everyone can use it and it will be a breeze to implement. It will be tested in multiple browsers and we will receive updates to correct issues that arise.

    My suggestions are:
    • For a modal pop-up dialog, provide a property to enable tab protection. When enabled, this generates additional code for you that will allow normal tab/shift+tab in the dialog but keep focus from leaving it. I suggest this as an optional property so it does not add overhead to your application if you don't want it, like for a mobile application.
    • For panels, provide a similar property, or create a special container that you can wrap around areas where you want to "fence in" the tab focus.


    In the meantime we can put our heads together in this forum and develop some standardized code and instructions on how to implement it. I'm sure we can come up with many different ways to solve the problem. I'm looking for something that is reusable and easy to implement, like a standardized function that I can make a single call to from each form.

    (continued in next message...)
    Last edited by Ben S.; 02-11-2018, 11:49 PM. Reason: Message was too long.

    #2
    Re: Warning that Modal Windows are not truly modal, and Panels have this issue too.

    (continued from previous message due to length)

    In the meantime we can put our heads together in this forum and develop some standardized code and instructions on how to implement it. I'm sure we can come up with many different ways to solve the problem. I'm looking for something that is reusable and easy to implement, like a standardized function that I can make a single call to from each form.
    Here are some suggestions I've already considered which I don’t feel are acceptable:
    • Pretend that your users would never hit the tab key.
    • Tell users not to hit the tab key.
    • Write code around the first and last control on every modal pop-up and panel to trap tab and shift-tab. Make sure the code is updated if the first or last control changes.
    • Don’t use panels or modal dialogs in any app that allows a keyboard.

    This video shows a solution someone else developed. It works for this one form, but I'm looking for something more reusable that doesn't have hard-coded control names in it.
    I found some Stack Overflow discussion of using jQuery to handle this. I don't have a lot of experience with web development. Can someone explain how I could implement code like this into an Alpha application? Review the other solutions on the page that list potential pitfalls.
    Thanks for reading this far. I think you can tell that I have been thinking about this for a while. Were you aware of the Tab loophole? Does it impact your web application?

    Ben
    Last edited by Ben S.; 02-11-2018, 11:55 PM. Reason: message was truncated

    Comment


      #3
      Re: Warning that Modal Windows are not truly modal, and Panels have this issue too.

      Very interesting!

      I haven't tested your findings yet, but I do know the a5.msgbox is definitely not modal. It's just a window. If you include it in the middle of a script, script execution will continue to the end unlike alert().

      I know I have had apps where I do trap the user's key strokes in certain situations to control navigation. But I would like to test it when I have a few minutes - the panels and modal UX.

      Thanks for letting us know.
      Peter
      AlphaBase Solutions, LLC

      [email protected]
      https://www.alphabasesolutions.com


      Comment


        #4
        Re: Warning that Modal Windows are not truly modal, and Panels have this issue too.

        This is interesting and concerning. I can certainly duplicate this behavior and I'm not sure how it has eluded detection for so long.

        Just wondering if you have approached Alpha about it?
        Alpha Anywhere v12.4.6.5.2 Build 8867-5691 IIS v10.0 on Windows Server 2019 Std in Hyper-V

        Comment


          #5
          Re: Warning that Modal Windows are not truly modal, and Panels have this issue too.

          Simple fix, depending on what you want to do. In the Popup UX, add this to the Javascript functions...

          Code:
          if (document.addEventListener){ 
          	document.addEventListener("keydown",keyCapt,false); //code for Moz
          }
          else {
          	document.attachEvent("onkeydown",keyCapt); //code for IE
          }
          
          function keyCapt(e){
          	debugger;
          	if(e.keyCode === 9){
          		if(e.target.name == 'V.R1.LAST_TEXTBOX'){
          			{dialog.Object}.setFocus('FIRST_TEXTBOX');
          	 		e.preventDefault();
          	 	}
          	}
          }
          Capture the TAB key. If you're on the last field, cancel the tab... and go to the first field. Otherwise... let the tab go. Tested in Chrome.

          Comment


            #6
            Re: Warning that Modal Windows are not truly modal, and Panels have this issue too.

            There was another thread on here about this a little while back. I seem to recall saying you could, in the onRenderComplete, set focus to one of the modal window controls and that solved the problem. Tab would then only cycle through controls in the window and not the parent. Could be wrong. Haven't tried this again since the last thread.

            EDIT: Found it: https://www.alphasoftware.com/alphaf...404#post732404
            Last edited by mikeallenbrown; 02-12-2018, 05:36 PM.
            Mike Brown - Contact Me
            Programmatic Technologies, LLC
            Programmatic-Technologies.com
            Independent Developer & Consultant​​

            Comment


              #7
              Re: Warning that Modal Windows are not truly modal, and Panels have this issue too.

              Originally posted by Davidk View Post
              Simple fix, depending on what you want to do. In the Popup UX, add this to the Javascript functions...
              That's a good start. How do you get it to find the first and last control that can receive focus so it doesn't have to be hard-coded and maintained? The Stack Overflow article I referenced had some suggestions. Also, it needs to to trap the shift-tab.

              Comment


                #8
                Re: Warning that Modal Windows are not truly modal, and Panels have this issue too.

                Originally posted by iRadiate View Post
                This is interesting and concerning. I can certainly duplicate this behavior and I'm not sure how it has eluded detection for so long.

                Just wondering if you have approached Alpha about it?
                This issue was brought up to Alpha in regards to tabbing to hidden panels. The response was along the lines of "this is not something we anticipated being a problem and so there is no built in protection."

                Comment


                  #9
                  Re: Warning that Modal Windows are not truly modal, and Panels have this issue too.

                  Originally posted by mikeallenbrown View Post
                  There was another thread on here about this a little while back. I seem to recall saying you could, in the onRenderComplete, set focus to one of the modal window controls and that solved the problem. Tab would then only cycle through controls in the window and not the parent. Could be wrong. Haven't tried this again since the last thread.

                  EDIT: Found it: https://www.alphasoftware.com/alphaf...404#post732404
                  Can you demonstrate how onRenderComplete works when implemented?

                  Comment


                    #10
                    Re: Warning that Modal Windows are not truly modal, and Panels have this issue too.

                    My explanation is in your other thread. I don't have a sample at the moment.
                    Mike Brown - Contact Me
                    Programmatic Technologies, LLC
                    Programmatic-Technologies.com
                    Independent Developer & Consultant​​

                    Comment


                      #11
                      Re: Warning that Modal Windows are not truly modal, and Panels have this issue too.

                      Put this into onRenderComplete... it sets up an array of controls... and get the first and last control.

                      Code:
                      var thisUX = {dialog.object};
                      var controls = thisUX.columnInfo;
                      var ctrlArray = [];
                      	
                      for (var key in controls) {
                      	if (!controls.hasOwnProperty(key)) continue;
                      	ctrlArray.push(key);
                      }
                      var firstCtrl = ctrlArray[0];
                      var lastCtrl = ctrlArray[ctrlArray.length-1];
                      {dialog.Object}.__tabOrderInfo = {};
                      {dialog.Object}.__tabOrderInfo.ctrlArray = ctrlArray;
                      {dialog.Object}.__tabOrderInfo.firstCtrl = firstCtrl;
                      {dialog.Object}.__tabOrderInfo.lastCtrl = lastCtrl;
                      Then the Javascript functions would be...

                      Code:
                      if (document.addEventListener){ 
                      	document.addEventListener("keydown",keyCapt,false); //code for Moz
                      }
                      else {
                      	document.attachEvent("onkeydown",keyCapt); //code for IE
                      }
                      
                      function keyCapt(e){
                      	var currCtrl = e.target.name.substr(e.target.name.lastIndexOf(".") + 1);
                      	if(e.keyCode === 9){
                      		if(currCtrl == {dialog.Object}.__tabOrderInfo.lastCtrl || currCtrl == ''){
                      			{dialog.Object}.setFocus({dialog.Object}.__tabOrderInfo.firstCtrl);
                      	 		e.preventDefault();
                      	 	}
                      	}
                      }
                      Now... there are lots of exceptions to deal with... so you'll need to work those out per popup. E.g. Buttons do not have a target name... it is empty. The above code takes care of this.
                      Buttons are not part of the dialog.Object controls list.

                      Some controls cannot get focus... e.g. a Checkbox control... so you'd possible need to work in a check for the control type... and not add that to the array built in onRenderComplete.

                      In your posted example, using this code, the cursor will happily cycle through the controls... and will not escape the popup window.
                      Last edited by Davidk; 02-12-2018, 09:04 PM.

                      Comment


                        #12
                        Re: Warning that Modal Windows are not truly modal, and Panels have this issue too.

                        Just report the bug.
                        Insanity: doing the same thing over and over again and expecting different results.
                        Albert Einstein, (attributed)
                        US (German-born) physicist (1879 - 1955)

                        Comment


                          #13
                          Re: Warning that Modal Windows are not truly modal, and Panels have this issue too.

                          Ben did report it... the information is in this thread.

                          Overall... the developer must look after their application... the flow... and behaviour. Many environments have run into this issue... some try to figure it out. Access had some solutions and Alpha desktop as well... but they were both messy and not always sufficient... and sometimes just bad.

                          If you're at the end of a page of input... and you want something specific to happen... then make it happen. If the environment can help then great... if not... look after it yourself.

                          I do agree that if you're in a UX and pop up a modal window... you should absolutely not be able to tab out out that window into a disabled background - that's just simply a bug. If I can fix it with a bit of Javascript then Alpha certainly should be able to. However, that's what we've got.

                          Panels are a bit different and I always treat them as a possible flow from panel to panel. If I don't want to, or shouldn't leave a panel, then I make sure that happens. I'm not sure I'd want Alpha interfering in this case.
                          Last edited by Davidk; 02-12-2018, 10:32 PM.

                          Comment


                            #14
                            Re: Warning that Modal Windows are not truly modal, and Panels have this issue too.

                            OK - agree on the both - the popup is a bug that won't be addressed and the panel is a feature. Good thing you are able to assist people David else who knows how people would move forward on issues like this.
                            Insanity: doing the same thing over and over again and expecting different results.
                            Albert Einstein, (attributed)
                            US (German-born) physicist (1879 - 1955)

                            Comment


                              #15
                              Re: Warning that Modal Windows are not truly modal, and Panels have this issue too.

                              I think the bug should be re-submitted... addressing only the non-panel, popup modal window, tab out issue. In a web page, popup window... tabbing through fields is common. You should never be able to tab out... and into a disabled background window... that's ridiculous... I've never seen that.

                              Comment

                              Working...
                              X