10 Replies Latest reply on Feb 4, 2011 10:47 AM by KenKing

    Simulating a Button

    KenKing

      Title

      Simulating a Button

      Post

      OK, I've been trying to figure this out for over an hour now....and searched many a forum. 

      I have a button which triggers a script.  The idea is that a user selects the button, and then a field on the layout formatted as a popup opens, showing values defined in a value list, thereby indicating to the user that input is required (i.e., select a value in the popup).

      But I can't get the popup to "pop" open.  I've tried "Go to Field", adding "committ record" to the script, and even Insert Text.  But I cant figure it out!  

      Is there a way to do this?

        • 1. Re: Simulating a Button
          philmodjunk

          Not that I know of. What is the purpose behinding making the user click two things just to open the pop-up menu instead of just directly clicking the field to open it?

          • 2. Re: Simulating a Button
            raybaudi

            "But I can't get the popup to "pop" open."

            Is this a Mac thing ?

            ( Because Win have no problems to open a value list ( either formatted as pop-up menu or drop-down list ) using the "Go to Field" script step )

            • 3. Re: Simulating a Button
              philmodjunk

              Good point. I was incorrectly generalizing from the fact that this doesn't work on windows when the arrow option is specified. It definitely works for a windows platform for pop up menus.

              I remain curious as to why you would want to do this. Perhaps trying to get around the fact that OnObjectEnter script triggers perform the script after the menu drops down (and the user selects a value) instead of before?

              • 4. Re: Simulating a Button
                KenKing

                Hi all, and thanks for the replies.  

                The reason for this:  I am trying to reduce hw resources needed for FMGo on the iPhone (loading new layouts lags, only slightly, but certainly is not a "fluid" experience).  I've found that FMGo handles pop up fields very well (using the iOS native wheel "Picker" design).  The button I referenced is an "add new record" button; when selected, the user can choose from the pop up what kind of record (contact, invoice, product, whatever).  Depending on that selection, the script branches to the appropriate layout to allow entry of a new record.  

                Hence, reducing layout navigation via substituting with buttons + popups seems to work fairly well. Plus, having a unified "add new record" button seems to make more sense than having the user first go to the appropriate layout and then request a new record. What do you guys think?

                I dont pretend to know what Im doing, so if you guys have any suggestions, please feel free.  I always appreciate the input of this forum's users. 

                ken

                • 5. Re: Simulating a Button
                  philmodjunk

                  You might consider using a script trigger set on the popup so that selecting a value in the pop up initiates the creation of a new record of the selected type. That let's you accomplish this all in one go. If this is a pop up menu, the OnObjectModify trigger could be used to perform such a script step.

                  • 6. Re: Simulating a Button
                    KenKing

                    Phil - to directly answer your question:

                    There is a static button that is the "add record" button.  Given i) space is at a premium on iOS, ii) the button is located on the title bar (or footer bar) and thus is always visible and a user will not have to hunt for it.  

                    BUT, if there were a way to make this field transparent, I could satisfy all the above by simply placing the invisible field on the status bar. I havent looked but I dont know if FM supports transparency (even though they support layers).  And I've assumed (I will verify) that if a field is arranged behind another object and is not visible, it will not be "selectable". 

                    ken

                    • 7. Re: Simulating a Button
                      KenKing

                      Phil,

                      That is exactly what I've done.  I was hopping that a clean plus sign (+) on my iOS title bar would trigger the script and pop open the popup.  

                      • 8. Re: Simulating a Button
                        philmodjunk

                        Perhaps it's because I don't have an iOS device, but I don't quite get the purpose of that when you can set this up so that selecting "contact, invoice, product, whatever" from the drop down can then create a record of that type for you without ever clicking anything but the pop up menu itself. (Usually, this is done with global field formatted as the pop up menu.)

                        • 9. Re: Simulating a Button
                          KenKing

                          That is compelling.  I suppose its simply a design/gui issue.  In which case, I now regret spending so much time on it!

                          • 10. Re: Simulating a Button
                            KenKing

                            Phil, 

                            Rereading this post, I think we were saying the same thing: once the popup menu is initiated, and a user selects "contact, invoice, product, whatever" from the "drop down", the script initiates (onobjectmodify) and creates the appropriate record.  

                            The key issue for me here was gui related: I couldn't show the gfield (formatted as a popup and initiate a script onobjectmodify) on the menu bar.  But, as Im sure is no surprise to you, I discovered I can hide fields behind graphic elements (such as a menu bar) and "clicking" on the right spot on the menu bar (e.g., a "plus" symbol graphic) still activates the global field hidden behind it, and pops up the menu.  

                            So, long story short, the fact that one can hide fields behind graphical elements to simulate a "button" was the key for me.  Pretty rudimentary stuff, but hey, Im still learning here!

                            Ken