1 2 Previous Next 21 Replies Latest reply on Aug 7, 2013 5:30 PM by danlee

    How to create pop window that auto size

    danlee

      Title

      How to create pop window that auto size

      Post

           I created a pop up window that I would like to have auto size and center on the screen.  I would like to show only the layout.  right now it has too much dead space from the pop up window.

           Also I have a button setup for each day, Day 30, Day 60 and Day 90.  I have a script that closes the small pop up window and opens the layout for that calorie menu.  But if I were to create a script to close that window and open the corresponding calorie menu I will have to to create a total of 36 scripts so they each go to their corresponding calories.  Is there an easier way to do this?  Here is what a script looks like if I were to choose Day 60 from 1200 Calories pop up window:

           Script to go to 1200 Day 60 Layout:

      Close Window [Current Window]

      Go to Layout ["1200_60 (CaloriesMenu)]

      Screen_Shot_2013-08-03_at_5.22.09_PM.png

        • 1. Re: How to create pop window that auto size
          schamblee

               To resize your window you need to add a line to your script  Adjust Window [Resize to Fit].

               You could have 1 script and use a script parameter for each button.  When you specify the script there is a box for optional script parameter at the bottom of the window, you would have something like 1200_60, then in your script you would use an if statement with if get(ScriptParameter) = "1200_60" then go to layout .  You would have an if statement and go to layout for each button.

          • 2. Re: How to create pop window that auto size
            danlee

                 Ok got the resize issue to work!  Thank you!  Quick question on the new window pop up.  Are there different ways to make the new window appear?  Like fade in or such?

                 I cannot get the script to work.  The layout that I need to appear is a container field.  So in the optional script parameter for one button I put in "CalorieMenus::cf_1200B".  It won't just let me put in 1200B.

                 Also in the 1 script I use:

                 Get ( ScriptParameter ) = "CalorieMenus::cf_1200B"; CalorieMenus::cf_1200B 

                 and get an expected operator is expected here.

                 How would I then write up the remainder?  1200C, etc in that if statement?  Sorry I am new to all of this and appreciate your help.

            • 3. Re: How to create pop window that auto size
              philmodjunk

                   FileMaker does not support window transistion effects such as fading in.

                   

                        It won't just let me put in 1200B.

                   Assuming that 1200B is the name of a field, you have to put in the full up reference to the field as you have discovered. That reference includes the name of a table occurrence before the :: plus the name of the field after the ::. If this is a field shown on your layout, make sure that the entry in your script parameter box exactly matches what you see when you select the field and check the Display Data From box in the Inspector's Data tab. This will pass the value stored in the 1200B field to your script.

                   

                        Get ( ScriptParameter ) = "CalorieMenus::cf_1200B"; CalorieMenus::cf_1200B

                   Correct SYNTAX would be: If ( Get ( ScriptParameter ) = "CalorieMenus::cf_1200B"; CalorieMenus::cf_1200B ) BUT that will not produce a correct RESULT. If you put CalorieMenus::cf_1200B in the optional script parameter box, you are passing the value stored in the CalorieMenus::cf_1200B field to the script and thus such an If step makes no sense. Get ( ScriptParameter ) will already return the value you are trying to extract with this expression. In place of If ( Get ( ScriptParameter ) = "CalorieMenus::cf_1200B"; CalorieMenus::cf_1200B ), just use Get ( ScriptParameter ).

              • 4. Re: How to create pop window that auto size
                danlee

                     Just making sure I understand this right.  I have table Calories Menu with field names, 1200B, 1200C, 1300A, 1300B, 1300C, etc.  All those fields are container fileds.  So as the picture from the first post shows, when I click say 60 Days from pop up window I need to put in the script parameter, CalorieMenus::cf_1200B, correct?  The script attached should be Get ( ScriptParameter ), but I do not see a Get function on the left side when I go in to create the script.

                • 5. Re: How to create pop window that auto size
                  schamblee

                       You can put anything in the script parameter.  It's like setting the value of a variable  then Get(ScriptParameter) return the value that was passed to the script.  Here is a sample app : https://www.sugarsync.com/pf/D9559058_78149901_835933

                  • 6. Re: How to create pop window that auto size
                    schamblee

                         I just displayed the button pressed, you would remove the set field script line and add your script....go to layout.

                    • 7. Re: How to create pop window that auto size
                      danlee
                           It works but when I try to close the window of the layout that it goes to I keep getting this error, "This operation could not be completed because the target is not part of a related table."
                            
                           This is what my script looks like:
                      • 8. Re: How to create pop window that auto size
                        philmodjunk

                             The error you report does not go with the script shown in your last post. Any chance that you have a scrit trigger set on the layout of the window that becomes the current window when this window is closed?

                        • 9. Re: How to create pop window that auto size
                          danlee

                               I checked and there is nothing set to that layout for that error to occur.  It only happens that container field opens up in a new window.  :(  Any other suggestion?

                          • 10. Re: How to create pop window that auto size
                            philmodjunk

                                 WHy do you close the first window before opening the new one?

                                 Why not leave it open and open the new window in front of it?

                                 If you remove/disable the close window step, does it make a difference?

                            • 11. Re: How to create pop window that auto size
                              danlee

                                   I added a close button to that cf_1200B layout and actually to all of the container field layouts to see what happens if I click the icon to close that container field and I always get that error!  :(

                              • 12. Re: How to create pop window that auto size
                                danlee

                                     Figured out what the problem is.  I created a CalorieMenus table and will be adding container fields in that table only.  I do not want these fields attached to any clients.  That is why I get the error.  But when I create those container fields in clients table that error does not occur.  Can I make this work with CaloriesMenu table only or will I have to set up all those container fields in the Clients table?

                                      

                                • 13. Re: How to create pop window that auto size
                                  schamblee

                                       It has to be in the same table, have a relationship between the two tables which can be done with the cartesian symbol, or a global field.

                                  • 14. Re: How to create pop window that auto size
                                    danlee

                                         Cool that worked.  I made the container fields in the CalorieMenu table a global field and no error and the pdf files shows up no matter which client record shows up! :)

                                    1 2 Previous Next