1 2 Previous Next 15 Replies Latest reply on Apr 5, 2017 4:05 PM by bHouston

    Portal Rows - Navigating with TAB and selecting buttons with ENTER

    bHouston

      I am using horizontal portals in a layout. I would like to be able to:

       

      1) Use TAB keystroke to move from a specific field (a field with scripted button functionality) in one portal to the same field in the next portal row.

       

      2) Use ENTER/RETURN keystroke to a) run the script attached to the selected/active field button and, b) go to the next portal row (as TAB would function).

       

      I've been playing with OnLayoutKeystroke and OnObjectKeystroke with the Trigger Keystroke codes but without success thus far. Thanks in advance for your time and help!

        • 1. Re: Portal Rows - Navigating with TAB and selecting buttons with ENTER
          philmodjunk

          Use Set Tab Order in the Layouts menu to check the tab order on your layout.

          • 2. Re: Portal Rows - Navigating with TAB and selecting buttons with ENTER
            ByteTheBullet

            If you want to move from one portal row to another, I don't believe tab order will help you. You're probably going to have to have an OnObjectKeystroke script trigger on your fields that intercepts the "TAB", "ENTER", and "RETURN" keystrokes and performs the actions you want based on which keystroke was captured.

             

            Create the script that performs the actions you want, and then set the script trigger. Make sure to pass the intercepted character to your script.

             

            You can use the Data Viewer to work out the right calculation to capture the keystroke. Since you want to intercept a <TAB>, <ENTER>, or <RETURN> character, you'll need to convert the intercepted character into it's code for the script parameter, and then have your script check the value of the parameter and perform the appropriate action.

            1 of 1 people found this helpful
            • 3. Re: Portal Rows - Navigating with TAB and selecting buttons with ENTER
              BruceRobertson

              Consider building and trying something before making another invalid comment.

              • 4. Re: Portal Rows - Navigating with TAB and selecting buttons with ENTER
                rgordon

                For an OnObjectKeystroke trigger script use

                Code ( Get ( TriggerKeystroke ) ) = 9  for a Tab

                Code ( Get ( TriggerKeystroke ) ) = 10 for a Enter

                Code ( Get ( TriggerKeystroke ) ) = 13  for a Return

                 

                Use an If statement to determine what to do based on what key is pressed.

                 

                Don't use an OnlayoutKeystroke trigger because it will work on any field on the layout.

                1 of 1 people found this helpful
                • 7. Re: Portal Rows - Navigating with TAB and selecting buttons with ENTER
                  ByteTheBullet

                  Oh? A script trigger to capture the keystroke and then perform an action based on that keystroke is somehow invalid? Please explain what's invalid about that. Other people have suggested the same approach, so if we're wrong about something, please educate us.

                   

                  Perhaps being a bit specific about what is invalid about the advice would be helpful as well, instead of just being a troll. Simply saying something is invalid is not terribly helpful to anyone. I'm always happy to learn new techniques, and if this technique is somehow wrong, perhaps you could post a method that would help the original poster.

                  • 9. Re: Portal Rows - Navigating with TAB and selecting buttons with ENTER
                    ByteTheBullet

                    Perhaps you missed the first point by the original poster?

                     

                    1) Use TAB keystroke to move from a specific field (a field with scripted button functionality) in one portal to the same field in the next portal row.

                     

                    Let's say you have 4 fields in a portal row. How exactly would you use tab order to go from the, say, 2nd field in row 1 to the 2nd field in row two of the portal? Or from row 10 to row 11? Or from row N to row N+1? The set tab order view only shows one row in a portal- rightly so, as there is an unknown number of rows that *could* be in the portal. And while you can set the tab order between fields *within* the portal row, you can't set a tab order *between* portal rows.

                     

                    But hey, if you of a way to do that, please show it. I'd love to learn it.

                     

                    • 10. Re: Portal Rows - Navigating with TAB and selecting buttons with ENTER
                      BruceRobertson

                      Nope. Didn't miss the point. Didn't miss your first sentence.

                      Your first sentence is false and it really doesn't help to begin a claimed solution with a known false statement.

                       

                      It is quite often the case that solution descriptions are best begun by making TRUE statements.

                      And by reminding ourselves of standard FileMaker behavior.

                      And then expanding on them to describe instances where complications occur or other features are desired.

                       

                      When a tab order is set up for items (fields; buttons) in a portal, tabbing from the last item in a portal row WILL move to the first tab-order item in the next portal row.

                      If you are in row 2 or higher, and on tab-order item 1, shift-tab will move you to the last tab-order item in the prior row.

                       

                      We may as well ALSO want to remind ourselves that when a button is in the tab order; standard behavior is that the button is triggered with the space bar.

                      Sometimes it even works out that when the developer and users are familiar with STANDARD behavior; they say; oh well that was easy.

                      OK! We're done.

                      IF other behavior is truly desired THEN we can move on to how to achieve it.

                      • 11. Re: Portal Rows - Navigating with TAB and selecting buttons with ENTER
                        ByteTheBullet

                        Well, at least you're providing some detail now. But you apparently *DID* miss the original poster's statement. Once again (and I've added some italics and bold to gain your attention to the relevant words):

                         

                        1) Use TAB keystroke to move from a specific field (a field with scripted button functionality) in one portal to the same field in the next portal row.

                         

                        He did not say the LAST field in a portal row. He wants to go from an arbitrary field in the row, to the exact same field in the next row. Not tab his way through how ever many fields he may have in the portal to get the the field in the next row, but to go there directly. So, first field in row one, directly to first field on row two, or second field in row one, to second field in row two, etc..

                         

                        I humbly suggest you re-read the original poster's question.

                         

                        If you still believe it possible to go from a field in one row, directly to the the same field in the next row via tab order (and assuming that there is more than one field in the portal row, of course- which is most like a safe assumption since the original poster said "a field" in a portal row and not "the field"), please provide the details. Perhaps even a simple demo so that you prove your statement. I'll happily admit I'm wrong if you can prove that I am. Thanks!

                        • 12. Re: Portal Rows - Navigating with TAB and selecting buttons with ENTER
                          BruceRobertson

                          You still seem to be misreading things.

                          I have NEVER said I believe that.

                           

                          If YOU want to immediately jump in and provide an example file - then of course you are welcome to do so.

                           

                          It is my preferred approach to make sure that bHouston fully understands FileMaker standard behavior.

                          What you get "for free".

                           

                          And after that - if he still wants to navigate using a method that requires more effort - then somebody can provide the examples or scripts.

                          Since he also mentions horizontal portals; it might be good if bHouston provides an example file of what he is working on, either as a complete file or as a screenshot.

                          • 13. Re: Portal Rows - Navigating with TAB and selecting buttons with ENTER
                            ByteTheBullet

                            I guess we'll chalk this up to a misunderstanding, then. My initial response was in the context of the original poster's question. You read my response outside of that context, as if it were a stand-alone statement, so I can see how you could see it as "invalid". If the OP wants to go from a field in one row to the same field in the next, simple tab order won't work unless the portal rows have only one field. If tabbing through fields in one row to the desired field in the next is okay, then that can absolutely be done, as you've stated.

                             

                            If your approach is to make sure the OP understands what FileMaker offers for free, why didn't you simply state that tab order can be used to navigate from field to field within a row, and when on the last field of a row, to the first field of the next row, at the outset, instead of leaving a vague comment about my post being invalid? Seems a strange way to help the OP understand what FileMaker offers to just say, in essence, "your statement is wrong". If you would have explained yourself earlier, we both could have saved some time, and not cluttered up the OP's thread (sorry, bHouston!).

                             

                            So, back to the OP's question: So far, you have two options. Use the OnObjectKeystroke as you said you've tried to capture the keystrokes you want to intercept and then have a script perform the desired actions, or tab through all the fields on your portal row to get from one field to the same field on the next row. Also, you can use FileMaker's built-in function of activating a button when hitting the space bar, as described by BruceRobertson, or if you need the ability to activate the button via <ENTER> or <RETURN> keys, again, use an OnObjectKeystroke script trigger.

                             

                            From your question, my understanding is that you wanted behavior beyond what tab order and using the space bar would achieve for you. rgordon has posted the syntax for grabbing the keystrokes you mentioned in your post, so you should have enough to go on to make this work for you either way.

                            1 of 1 people found this helpful
                            • 14. Re: Portal Rows - Navigating with TAB and selecting buttons with ENTER
                              user19752

                              Did you see the first line of first post, "horizontal portals" ?

                              It looks me meaing many portals each have one row with fields, and want to go to netxt "portal" with tab key.

                              1 of 1 people found this helpful
                              1 2 Previous Next