8 Replies Latest reply on May 28, 2014 6:49 AM by philmodjunk

    Popover as data entry

    filemakernew

      Title

      Popover as data entry

      Post

           Hi Board,

           I'm trying to use a Popover to enter a new record, I've been playing for a long time but I didn't get any luck to accomplish what I want. If I clicked my Add material button, my popover is not appearing.

           Please find attached link for the sample file

            

           Any help is appreciated.

           Thank you so much.

            

           File

        • 1. Re: Popover as data entry
          philmodjunk

               I do not have time at this point to download an examine your file. (And I am reluctant to examine shared files unless a "road map" to the particular layout and scripts is provided anyway..)

               But a common issue with popovers is when Go to Object is used in an attempt to open a popover so that clicking a button other than the popover button can open that popover. This works, but you have to give the popover Frame, not the popover button, an object name and then your button or script uses go to object to specify the object name of the Frame instead of the button.

          • 2. Re: Popover as data entry
            filemakernew

                 Hi Phil,

                 Thank you for your reply. I followed your suggestion now, my popover is appearing. can you also help me with my other problem. If I will create a new record using the popover, if I will Click my Add Material button the previous material that I add is still there, how can I remove my previous entry.

                 The Script that Im using is 

                 Go to Object[Object Name: "Add Material"]

                 Set Variable [$$scriptTrigger_off; Value:1]

                 New Record/Request

                 Set Field[Products::Material_name]

                 Set Field[ Products::Material_lot no.]

                 Set Field[Products::MAterial_code]

                 Set Variable{$$ScriptTrigger_off;Value:""]

                 Commit Records/Request[ ]

                 Thank you.

            • 3. Re: Popover as data entry
              philmodjunk

                   Your SEt field steps do not do anything in this script as they are missing the calculated result parameter.

                   When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Do not click the specify button next to the repetition box. Click OK to close this dialog box. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.

              • 4. Re: Popover as data entry
                filemakernew

                     Go to Object[Object Name: "Add Material"]

                     Hi Phil, 

                     Please forgive, I think Im not following your suggestion, I tried to change but still my previous  data is still there. my scripts are below.

                     Set Variable [$$scriptTrigger_off; Value:1]

                     New Record/Request

                     Set Field[Products::Material_name; Products::Material_name ]

                     Set Field[ Products::Material_lot no.; Products::Material_lot no.]

                     Set Field[Products::Material_code;Products::Material_code]

                     Set Variable{$$ScriptTrigger_off;Value:""]

                     Commit Records/Request[ ]

                     Thank you.

                • 5. Re: Popover as data entry
                  philmodjunk

                       That was just the most obvious thing wrong with your script. Taking an actual look at your file, this script appears to be one you want to use for adding a new record to the Products table. The set field steps do not appear to be needed at all as New Record/Request should create a new blank record in the products table.

                       I would appear that your script should be:

                         
                  •           Set Variable [ $$ScriptTrigger_off; Value:1 ]
                  •      
                  •           New Record/Request
                  •      
                  •           Go to Object [ Object Name: "Add Material" ]
                  •      
                  •           Set Variable [ $$ScriptTrigger_off; Value:"" ]

                       Both New Record/Request and Commit Records will close the popover. Commit Records is not needed in this script.

                        

                  • 6. Re: Popover as data entry
                    filemakernew

                         Hi Phil,

                         Thank you so much. I got it.

                         One more question, how can I avoid a popover from closing when clicking outside the panel. I want that If I accidentally click outside the popover it will warn me, so that the data that I entered will not lost.

                         Thank you so much.

                          

                    • 7. Re: Popover as data entry
                      hbrendel

                           Did you consider to use a modal window to achieve this?

                      • 8. Re: Popover as data entry
                        philmodjunk

                             You want the popover to not do what it was specifically designed to do--close when the user clicks the layout background.

                             Like Hbrendel, I would not use a popover for this if that behavior is undesirable. You can open a new modal window for collecting the user input.

                             But I have seen posts where others have scripted things to keep the popover open.