11 Replies Latest reply on Dec 17, 2013 1:42 PM by DominiqueHawinkels

    Drop-down lists not dropping down

    andreb

      Running FMPA 11.0.4 on Snow Leopard 10.6.8.

       

      I've recently came across a strange drop-down list behavior and want to find out if anyone else has seen it or can replicate it on other versions/platforms.

       

      In the attached file I created just to illustrate the problem, there is a conditional value list whose values are determined by the text value in a global field. The global is set by script triggers as each respective field is entered. The fields using the value list alternate with regular edit fields in the tab order:

       

      Field A with drop-down list

      Regular edit field

      Field B with drop-down list

      Regular edit field

       

      The problem for me is the value list DOES NOT drop down when tabbing into the fields which have a drop-down defined. What I see is exactly the same as tabbing into a regular edit field.

       

      So I tried getting rid of the regular edit fields (either deleting them from the layout or removing them from the tab order). Now the fields with drop-downs work as expected, i.e. they actually drop down when you tab into them.

       

      I haven't been able to fix this other than removing the edit fields or bunching the drop-down fields together, which is not always feasible.

       

      Can anyone shed some light on the matter? Would be nice if it was just me stuck in a rut not seeing something ridiculously obvious.

       

      Andre

        • 1. Re: Drop-down lists not dropping down
          Mike_Mitchell

          I don't see any difference in behavior. There's no drop-down on either layout; the field just populates with the related value.

          • 2. Re: Drop-down lists not dropping down
            andreb

            OK, then why don't the drop-downs work? What can I do to make them show the list of related values?

            • 3. Re: Drop-down lists not dropping down
              Mike_Mitchell

              Your value list is very complicated. What exactly are you trying to accomplish?

              • 4. Re: Drop-down lists not dropping down
                Mike_Mitchell

                Andre -

                 

                I'm not near my computer at the moment, but I think the problem is coming from a lack of focus. Your Script Trigger sets the global field to establish the relationship. I think that, since the OnEnter trigger traps the event, the Set Field is overriding the drop-down.

                 

                Try removing the global field from the layout. It's not needed anyway. Also, you can use a Go to Field script step to shift focus back to the correct field.

                 

                Mike

                • 5. Re: Drop-down lists not dropping down
                  andreb

                  To answer your first question, the value list is set up to show a different set of values depending on which field is active. I understand this is a standard conditional value list implementation with the global field set by script trigger to establish the correct relationship.

                   

                  What I cannot figure out is why the first layout doesn't work for me but the second one does. There is nothing different about the scripts, triggers or values on the second layout apart from the absence of the other edit fields.

                   

                  So your suggestions to remove the global field (which is there just to confirm the relationship works) or add a Go to Field step—both of which I tried with no effect—should make no difference logically.

                   

                  BTW, what version and OS are you using?

                  • 6. Re: Drop-down lists not dropping down
                    Mike_Mitchell

                    I didn’t have a lot of time to play with it this morning, but as an experiment, I duplicated one of the layouts and removed the script triggers. When this is done, the value list behaves normally. (Setting the global manually.)

                     

                    As I suspected, the problem is in the script triggers. I’ll play with it some more later today and see if I can come up with something that will work for you.

                    • 7. Re: Drop-down lists not dropping down
                      Mike_Mitchell

                      Okay, Andre. I thought about this while driving to work. (Driving doesn't require a lot of brain power.)    I recalled that the problem comes from the need for a record commit to re-establish the relational join once you change the value of the global. FileMaker doesn't know what the related set is unless you do.

                       

                      See if the attached works for you.

                       

                      Mike

                      • 8. Re: Drop-down lists not dropping down
                        andreb

                        Thanks, Mike. It does make sense to commit the record to re-establish the relationship, but that doesn't explain why the second layout works for me but the first doesn't.

                         

                        Now, with your modifications, the reverse is true: The first layout works for me, but the second doesn't. With the second, I get a glimpse of the drop-down list and it immediately disappears. I am also not able to tab to the next field—even though the tab order is unchanged. I seem to be stuck in whatever field I click into.

                        • 9. Re: Drop-down lists not dropping down
                          Mike_Mitchell

                          That's because I didn't modify the second layout. 

                           

                          The code doesn't work on the second layout because the object names aren't assigned to the fields. That's required.

                           

                          As an aside, this can be greatly simplified if you eliminate the OnExit trigger. Unless there's a compelling need to clear out the global field for some other reason, the fact that you set it when the user enters the fields with the drop-down should suffice. This eliminates a lot of the need for all the trigger suppression I had to build in to keep it from looping when the record is committed.

                          • 10. Re: Drop-down lists not dropping down
                            andreb

                            Ah, yes I see. My apologies for missing that. Thank you for your help.

                            • 11. Re: Drop-down lists not dropping down
                              DominiqueHawinkels

                              Andre -

                               

                              Thank you for the interesting challenge.  It has been fun following it through.

                               

                              Some comments I would like to make.

                               

                              (1) Value lists are built on field entry

                              (2) A drop-down will not appear if the linked valuelist calls an invalid (empty) relationship.

                              (3) The valuelist must have a valid (not empty) relationship prior to the field having focus.

                              (4) Valuelists persist until script sequence is halted, such as entering and then leaving a field with no script triggers or changing focus through "Goto Field or "Set Field". (i.e. Script triggers allow for one long script with subscripts).  This is why one (onExit) script could create an empty relationship then the next (onEnter) script could rebuild it.

                               

                              Mike's modifications to the scripts and layout allowed for this by building the relationship and then re-entering the field.

                               

                              Also the suggestion of not using the clear_global has the similar effect, except if you noticed, when you first start, no drop-down will appear until Animal is populated.

                               

                              If I got something wrong here or someone can explain better, please do.