11 Replies Latest reply on May 21, 2013 6:41 PM by rgordon

    Script the Committal of Multiple Selections from a Dropdown?

    user11613

      You can select multiple values in a dropdown list by holding command (Mac) and clicking. The thing is, it seems that the only way to save those selections is to hit Enter or Return. I have a part of a layout where I want the ability for the user to click on a dropdown list and select one or more values and then click a button to run a script that processes those values. The problem is that clicking the button and starting the running of the script does not commit the selections to the field if multiple selections were made. The user would have to hit Enter and then click the button, which is a pain to train users to do. Is there a way to let the user select multiple values and automatically save or commit those selections at the time the button is pressed?

        • 1. Re: Script the Committal of Multiple Selections from a Dropdown?
          Steve Wright

          Personally, I dont find multiple selections in a popup menu to be intuitive, plus the multiple selections are hidden when its not active.  Is using a checkbox set out of the question instead?

          • 2. Re: Script the Committal of Multiple Selections from a Dropdown?
            user11613

            A checkbox won't work for these purposes.  The value list will change in size and could grow to be hundreds of items, and I don't want to reseve room on the layout for hundreds of checkboxes.  Besides, this will not be used for data storage.  It will just be used for data entry.  Once one or more items has been selected from the list, the user hits the green button and a script adds those items as new records in a related table.  Those new records are displayed in a portal on the layout.  The other advantage of this system over checkboxes is that it's easier to see at a glance what the selected items are.  Which a hundred checkboxes, you'd have to scan the whole list to see which ones are checked.

             

            fm ui.png

            • 3. Re: Script the Committal of Multiple Selections from a Dropdown?
              debi

              user 11613,

               

              Have you tried a "Commit Record/Request" script step at the top of your script?

               

              Debi Rubel

              FullCity Consulting

              • 4. Re: Script the Committal of Multiple Selections from a Dropdown?
                user11613

                debi wrote:

                 

                user 11613,

                 

                Have you tried a "Commit Record/Request" script step at the top of your script?

                 

                Debi Rubel

                FullCity Consulting

                 

                Yeah, it doesn't work.  If there is a value in the field, Commit Records/Requests commits it.  The problem is that there is no value in the field yet.  There are just selections in the dropdown list which seem to get forgotten when Commit Records/Requests executes.  What I really need is a script step that has the same effect as the user hitting Enter.  Does such a script step exist?

                • 5. Re: Script the Committal of Multiple Selections from a Dropdown?
                  ch0c0halic

                  Debi may not be fully committed,

                   

                  Yes, its called Commit Record/Request. It does the same thing the Enter key does. It exits the record and commits the changes.

                   

                  How did you get the Drop down list or Pop up menu to look like that? I don't know how you got a double column display.

                   

                  Could you post your script? Could be we might see something you can do to produce what you want.

                  • 6. Re: Script the Committal of Multiple Selections from a Dropdown?
                    ChrisPye

                    If the selections are going to end up in a portal, why not just show the portal and get the user to drag and drop the selections onto the portal?  Or you could have it so that when a selection is clicked it gets added to the portal.

                    • 7. Re: Script the Committal of Multiple Selections from a Dropdown?
                      user11613

                      The issue is that the user will be at this state when they have selected multiple items.  Then they click the green button which starts a script.  If the script has Commit Records/Requests, the field reverts to blank. You can try it yourself.  It wouldn’t really help to post my script.  Just a one line script with Commit Records/Requests will demonstrate the same behavior.

                       

                      fm dropdown.png

                      • 8. Re: Script the Committal of Multiple Selections from a Dropdown?
                        user11613

                        Choc,  If you have typed a value into a field, but have not committed it, then yes hitting Enter and executing Commit Records/Requests both have the same effect of committing the record.  I am talking about something somewhat different.  I am talking about selecting mutiple values in a dropdown list and using Enter or some other scripted alternative to transfer the selections from the dropdown list UI to the field. 

                         

                        The two column thing you are looking at is 2 separate portals.  The one on the left shows records 1-10. The one on the right shows records 11-20.

                        • 9. Re: Script the Committal of Multiple Selections from a Dropdown?
                          debi

                          Hmmm, yes, now I see what's happening - or NOT happening. I think I ran into something similar before; apparently value lists do not always work as expected. For instance, I just tried to resolve your problem with a variety of triggers and let statements to no avail.

                           

                          Another UI option would be two portals (or more, if you want to keep the multi-column design you have now); one of "available" topics, ideally it would dwindle as items are picked from it and added to the "selected" topics.

                           

                          If you figure out how to do it with the drop-down, please post back!

                           

                          ~debi

                          • 10. Re: Script the Committal of Multiple Selections from a Dropdown?
                            ch0c0halic

                            You can get a different paradigm to work. Make the Return key work for you.

                             

                            Remove the button and use an "OnObjectModify" script trigger to run your script. This forces the user to use the Enter key to commit the selections, which as you've discovered is the only thing that works for committing the multiple selections, and the script trigger to run your script. This has the benefit of freeing up that space.

                             

                            From my observations:

                            A drop down list is designed for a single selection and automatically exits the field on mouse up, unless the command key is down. The Commit of multiple selections is not on leaving the field like it is in a regular display field. You must be explicit that the multiple entries is what you really want by using the Enter key to submit the changes. There is no other FMP accepted way to indicate you really want all those selections.

                             

                            The behavior of multiple selections in a drop down list is not documented (at least I can't find any) so I would recommend not using it. Just because you can select multiple items from a Drop Down list does not make it advisable to do so. If FMP should decide to change this behavior your solution would break. My reasoning is that undocumented behaviors have been changed in the past so it is possible this could change at some time in the future.

                            • 11. Re: Script the Committal of Multiple Selections from a Dropdown?
                              rgordon

                              Try using a modal window with a scrolling portal in the window to show the values in the list.  Then have the user select from the portal.