1 2 Previous Next 16 Replies Latest reply on Feb 22, 2013 7:36 PM by steve_ssh

    IWP - "Go to Field" doesn't work for drop-down lists, any workarounds?

    g@briellelevenson

      In IWP, the script step "Go to Field" makes the keyboard active in that field (so you can arrow up and down), but it doesn't expand the drop-down list. Does anyone have any workarounds or suggestions for getting the dropdown list to open? (besides not using IWP?)

       

      Thanks!

        • 1. Re: IWP - "Go to Field" doesn't work for drop-down lists, any workarounds?
          BowdenData

          Hi,

           

          No way to do this that I am aware of. I had this very question come up recently in an IWP published dB. I tried a few things and asked other local developers. The consensus was no.

           

          Let's see if anyone comes back with something clever.

           

          HTH.

           

          Doug

          • 2. Re: IWP - "Go to Field" doesn't work for drop-down lists, any workarounds?
            steve_ssh

            Hello Gabrielle and Doug,

             

            When I saw this post, I thought that it would make an excellent puzzle to try to solve.

             

             

            I'd like to mention one potential workaround:

             

               The dropdown menu objects as rendered in IWP can be enhanced to dynamically resize the number of visible option elements.

             

            This can be used to create an effect that I think could be described as a "pseudo-opening" of the dropdown menu.  It is achieved through the use of a small amount of Javascript to interact with the menus.

             

             

            Attached to this post should be a sample file:

             

            I have thrown together a simple demo file to illustrate this idea, and for you to consider to see if it shows any potential for helping out with your particular project scenarios.

             

            If you have any questions about this, or if anything is unclear, please let me know.

             

            I hope you enjoy it.

             

            Best,

             

            -steve

            • 3. Re: IWP - "Go to Field" doesn't work for drop-down lists, any workarounds?
              Oliver_Reid

              I have used a portal with a script attached to buttons in each row in lieu of drop downs: The menu is pernanently dropped though. You can make it appear to "appear" but setting global that makes the relationship vallid and committing, but you can't use the real estate that is freed up.

              • 6. Re: IWP - "Go to Field" doesn't work for drop-down lists, any workarounds?
                g@briellelevenson

                Hi Steve,

                 

                I'm really curious to test your method out.  I downloaded your file and followed the instructions, but am not entirely clear on how it's supposed to work.  Would you mind walking me through it? 

                 

                I guess the biggest thing I don't understand is what you mean by "add an empty text object to the layout".  Do you mean create a new field that is meant to stay empty?  Or add text to the layout that you hide somewhere?  I've tried both and didn't seem to have any luck. 

                 

                Also for "add a tooltip to each menu item you wish to modify"...do you mean add the tooltip to my field with the dropdown list that I want to expand?  Does this mean I am putting the tooltip on 2 objects on my layout?

                 

                And then lastly, for the sample custom menu data that you supplied, what is "TEXTOBJECT" supposed to signify?  Am I supposed to name my dropdown field object with that name? 

                 

                Sorry, I am pretty adept in Filemaker but have no experience whatsoever with JavaScript, and rarely use custom functions.  Your help on this is really appreciated!

                 

                Here's what I've done so far (and tested unsuccessfully in Firefox 10.0):

                 

                1) Added the custom function "IwpCustomizeDropdownMenu" to Filemaker

                2) Created a new text field that I called "Empty_for_Dropdown" and put it on my layout

                3) Added "Empty_for_Dropdown" to my layout, and set its tooltip to:  IwpCustomizeDropdownMenu ("TEXTOBJECT" ; "" ; "")

                 

                 

                Thanks,

                Gabrielle

                • 7. Re: IWP - "Go to Field" doesn't work for drop-down lists, any workarounds?
                  steve_ssh

                  Hello Gabrielle,

                   

                  I'll try to clarify a few thing by interspersing answers to your questions below.  I've also included a few pointers for how to start this endeavor.  Hopefully this will all help.

                   

                  Feel free to ask as many questions as it takes to have this make sense.  It is actually rather simple to implement -- My instructions have probably just made it seem more complex than it really is.

                   

                  Very best,

                   

                  -steve

                   

                   

                   

                  The first thing I'd suggest:

                   

                  I'd suggest taking the demo file and allowing FM to host it as an IWP file, and then log into it via your web browser (username: "Admin" - no password), and check to see if it works for you.  It has two layouts to demonstrate the difference between using this technique, and not.  This would be an important/good starting point, just to make sure that the technique renders well for you, and that it looks like something that you might want to utilize.  If, for any reason, the demo file does not behave as expected, this step could save a lot of energy and prevent frustration.

                   

                   

                  The next thing I'd suggest:

                   

                  I'd suggest working on a copy of the layout in your file that.  This way, if you decide that this is not a good avenue for you to pursue, you can easily revert back to your clean file.

                   

                   

                  If you have not yet done so:

                   

                  I'd suggest examining the last layout of the demo file in layout mode, inspecting each of the objects, and seeing how the tooltips are defined for each one.  I think that this could really help to illustrate points in ways that my words don't.

                   

                   

                   

                   

                   

                  Answers to questions:

                  I guess the biggest thing I don't understand is what you mean by "add an empty text object to the layout".  Do you mean create a new field that is meant to stay empty?  Or add text to the layout that you hide somewhere?  I've tried both and didn't seem to have any luck.

                   

                  By "adding any empty text object to the layout", I meant your second option:  Adding some text to the layout using the Text tool.

                   

                  Just a small object with a couple of space characters in it will do just fine.  In retrospect:  technically, it is not empty since it has a couple of space characters.  Perhaps I should have referred to this as a "trivial" text object.

                   

                  As an example:

                   

                  Check out the last layout in the demo file.  When in layout mode, you should see a small object in the upper left corner of the layout.  It is a text object that just holds a couple of space characters -- but it also has a tooltip defined.  You will need to add an object like this to your layout.

                   

                   

                  The tooltip calculation for this text object should be exactly the same as what I did in the demo file:

                   

                      IwpCustomizeDropdownMenu ( "TEXTOBJECT" ; "" ; "" )

                   

                  If you wanted to, you could probably just copy the object directly out of the layout of the demo file, and paste it into the layout of your file.

                   

                   

                   

                  Also for "add a tooltip to each menu item you wish to modify"...do you mean add the tooltip to my field with the dropdown list that I want to expand? 

                   

                  Yes!  That's it.  I was trying to cover the case where you might have multiple dropdown menus, so my instructions were a little wordy.

                  If you just have a single dropdown menu on your layout, then I could have kept things simple by just saying:  "Add a tooltip to your dropdown menu."

                   

                   

                   

                  Does this mean I am putting the tooltip on 2 objects on my layout?

                   

                  Yes! Indeed -- if you have a single dropdown menu on the layout, then you will be adding a tooltip to two objects on your layout:

                   

                       - The text object that just has a couple of space characters for its text

                      - The dropdown menu

                   

                   

                  The tooltip calculation for your dropdown menu should be something like this:

                   

                     IwpCustomizeDropdownMenu ( "ALL" ; 20 ; "" )

                   

                   

                   

                  And then lastly, for the sample custom menu data that you supplied, what is "TEXTOBJECT" supposed to signify?

                   

                  When you use "TEXTOBJECT" as an argument to the custom function, you are letting the custom function know that the tooltip in question has been attached to the trivial text object.  This will cause the custom function's output to be different than had you not suppied this argument.  Essentially, it is a flag that tells the custom function to behave differently that it would without it.

                   

                   

                   

                  Am I supposed to name my dropdown field object with that name? 

                   

                  No.  The only place that you need to cite "TEXTOBJECT" is in the tooltip attached to the trivial text object.  It doesn't matter what layout object name (if any) is assigned to the dropdown menu field.  This technique does not make use of any layout object names -- the tooltips are the key.

                   

                   

                   

                  Here's what I've done so far (and tested unsuccessfully in Firefox 10.0):

                   

                  1) Added the custom function "IwpCustomizeDropdownMenu" to Filemaker

                  2) Created a new text field that I called "Empty_for_Dropdown" and put it on my layout

                  3) Added "Empty_for_Dropdown" to my layout, and set its tooltip to:  IwpCustomizeDropdownMenu ("TEXTOBJECT" ; "" ; "")

                   

                  What you've done is a perfectly fine start.

                   

                  Here's how I'd suggest you proceed:

                   

                     1) Remove the following field from the layout:   Empty_for_Dropdown

                   

                     2) Add a "trivial" text object to the layout -- just add some text which is nothing more than a few space characters.

                   

                     3) Add the following tooltip to the text object you added in the previous step:     IwpCustomizeDropdownMenu ( "TEXTOBJECT" ; "" ; "" )

                   

                     4) Add the following tooltip to your dropdown menu layout object:     IwpCustomizeDropdownMenu ( "ALL" ; 20 ; "" )

                   

                     5) View the IWP page in your browser, and see how the menu object now behaves.  If you navigate the user to it using a GoToField script step, it should now appear opened up when the page loads.

                   

                   

                   

                  The above steps should be all that you need to do.   If you are not using Empty_for_Dropdown for anything else, then you could go ahead and delete it from your schema.  You might later adjust the parameters in the dropdown menu's tooltip, but that would just be for fine-tuning the situation, once it is working properly.

                  • 8. Re: IWP - "Go to Field" doesn't work for drop-down lists, any workarounds?
                    g@briellelevenson

                    Steve, thank you SOOO much for the very well detailed explanation!  After walking through your steps, I was able to get it working and it is exactly what I was looking for!

                     

                    Since you took all the time to help explain this to me, it's only fair that I tell you the embarrassing reason that I couldn't get it working originally.  I was opening your sample database as readonly (it was still in the zipped folder), and when I tried digging in under the hood, I would get an error saying "This action cannot be performed because this file is not modifiable".  I just thought you were protecting your IP and somehow had those features disabled, and so I didn't even consider mentioning that as part of my original response to you.  The most important problem with my failed tactic is, I didn't actually copy any of your code into the custom function.  Filemaker fail on my part.  :-/ 

                     

                    But now thanks to all your help, the function is functioning as expected!  Thanks for the great solution.

                    • 9. Re: IWP - "Go to Field" doesn't work for drop-down lists, any workarounds?
                      steve_ssh

                      Hi Gabrielle,

                       

                      I am very pleased to hear that it worked out well.  Thank you for the update - it is really rather satisfying to see these types of solutions fall into place and make things a little better.

                       

                      As a last suggestion/reminder:

                       

                        I hope that you will try to test this out on the set of browsers that you expect to support -- at least as best as you can.

                       

                      I have done all that I could do (within reason) to try to make the code play friendly -- even with browsers that it can not support (presumably the older ones, e.g. IE7).  That said, It's always a very good idea to put the code through its paces in the real setting where it is being used.

                       

                      Very best,

                       

                      -steve

                      • 10. Re: IWP - "Go to Field" doesn't work for drop-down lists, any workarounds?
                        g@briellelevenson

                        Thanks Steve!  I've confirmed that it works in Firefox 10.0, but unfortunately it doesn't seem to work on IE8 in my solution.  We're already stating that Firefox is the preferred browser, and I'm ok with it not working on IE, bummer though!

                         

                        Again thanks so much!

                        • 11. Re: IWP - "Go to Field" doesn't work for drop-down lists, any workarounds?
                          steve_ssh

                          Hi Gabrielle,

                           

                          Thanks for the update, and I'm really glad that you are testing it.

                           

                          The funny thing is that I developed/tested this with supporting IE8 in mind and, after a few tweaks to the code, I got it to work on IE8 on a virtual machine.  My goal was to get it to work on IE8, IE9 and forward (as well as other major browsers).  I'm going to run my tests again, just to make sure that I didn't space out about something.

                           

                          If it's important to try to get this running on IE8, we can try to troubleshoot whatever is happening on your machine, but I'm not sure that it would be worth your time to try to chase that down.  If I don't hear from you, I'll figure that you have decided to live with it as-is.

                           

                          Very best, and thanks for the feedback,

                           

                          -steve

                          • 12. Re: IWP - "Go to Field" doesn't work for drop-down lists, any workarounds?
                            nicola

                            Hi Steve, I have read this thread with great interest and allowed myself to download your demofile, too. I put your file on a Filemaker Server Advanced 12 and tried the 2 layouts in IWP. To my surprise both layouts behave the same, a dropdown only appears when I click on the field but not by tabbing or scriptstep....what could I have done wrong? I am on a windows-server, using Mozilla 18.0.2 and IE8.

                            My original Problem was this: I have a list in IWP. A click on a field in browse-mode is supposed to go into another layout, same click in find-mode is supposed to go into the field itself, which could be a also a dropdown. In all browsers but IE it works halfway, the list opens but you have to keep the finger down to keep it open, in IE the list opens but you cannot make a change even if you manage to select sth....This is what happens when the button is attached to the field. Now I tried to put the button as an extra-object on top of the field - thatßs what leads me here, the dropdown doesn´t open at all.

                            I hope I do not steal your time with this, you seemed to be interested in this kind of puzzles and I really hope your JavaScript-Knowledge(which I have no clue of) might help.

                            Thanks a lot in advance

                             

                            Nicola

                            • 13. Re: IWP - "Go to Field" doesn't work for drop-down lists, any workarounds?
                              nicola

                              Hi Steve, thank you very very much for this great function!! You saved me from totally changing everything.

                              I only had to add filemaker pro 12v3 in the javascript-code and its working perfectly!

                              Many thanks again - Nicola

                              • 14. Re: IWP - "Go to Field" doesn't work for drop-down lists, any workarounds?
                                steve_ssh

                                Hello Nicola,

                                 

                                Thank you for both of your messages.  I am very glad to know that you have it working well!

                                 

                                I saw your first message earlier this morning, and because of it, I reviewed my code to see if I could discover what was wrong.

                                 

                                The result is that I believe I will be able to post an improved version of the function which will be compatible back to IE7 (may be helpful for some folks).

                                 

                                I will also include the change that you made so that the function will work with v12.03.  I have that check in there as a point of caution, since it is not for sure that this function will be forwards compatible with all future versions of FileMaker.  I am glad that you saw that and thought to update it.

                                 

                                I expect that I will be posting the updated version within the next two days, after I have had a chance to test it some more.

                                 

                                Very best and kind regards,

                                 

                                -steve

                                 

                                 

                                p.s.  I note that you have another recent post regarding dropdown lists and IWP, but I have not sufficiently understood the scenario that you describe.  I will try to re-read it to see if I can understand it better.  I am curious to know if that is still an open issue for you.

                                1 2 Previous Next