10 Replies Latest reply on Nov 30, 2009 5:03 PM by philmodjunk

    Moving items in a list

    mattb

      Title

      Moving items in a list

      Post

      I'm a Visual Foxpro programmer new to FMP.  I'm attempting to rebuild a commercial Windows VFP application using the Mac OSX version of FMP and essentially duplicate all functionality.  However, it appears that VFP has more pre-built objects in its screen building toolbox than FMP does and I'm struggling with what I considered to be a few basic issues.

       

      For example, last week I noticed that FMP doesn't have listbox objects like VFP does.  I put the question out on this forum and got an excellent reply - use a Portal with a copy of a table that has a self-referential relationship to the original table.  That did the trick and now I have listbox capability in FMP.

       

      But now I need to take the next step.  VFP listboxes have an option to turn on "mover buttons" in the listbox object which allows the user to move individual list items up and down within the listbox using the mouse.   I see this function in the FMP development environment itself - look at the Manage Databases Tables and Fields tabs.  These screens have double-vertical arrows on the left that provide this functionality.  

       

      My question is:  how can I insert this functionality into the screens I'm building in FMP?  I don't see any way to do that.   I'm hoping there is a way.

       

       

       

      Matt Bloomfield

        • 1. Re: Moving items in a list
          philmodjunk
             Your portal can specify a sort order. With some scripting, you can add buttons to your portal that modify a field used in the portal's sort order to change the order of the portal rows displayed. It's definitely not a drag and drop functionality, but it might be just enough to do what you need.
          • 2. Re: Moving items in a list
            mrvodka
              

            This is slightly advanced, but take a look.

             

            http://www.excelisys.com/web/downloads/files/Drag-and-Drop.zip

            • 3. Re: Moving items in a list
              philmodjunk
                

              WOW

               

              That demo just opened my eyes to some interface possibilities I hadn't dreamed were possible with FMP!

              • 4. Re: Moving items in a list
                mrvodka
                  

                What makes this work is that the auto entry will fire before the script trigger does. It was unexpected behavior that even those at FMI were suprised about. It was showcased at DevCon.

                 

                • 5. Re: Moving items in a list
                  DLW-BPEX
                    

                  This is excellent. One question: Would these techniques be compatible with Web publishing? All the various script steps appear to be compatible, but my understanding of graphics in container fields suggests that is where Web publishing could not handle it. Is that correct?

                   

                  Thank you.

                  David 

                  • 6. Re: Moving items in a list
                    philmodjunk
                      

                    Web publishing doesn't support script triggers.

                     

                    Another Caveat to consider, since this is "...unexpected behavior that even those at FMI were suprised about", there's no guarantee that it will work in a future release of the database.

                    • 7. Re: Moving items in a list
                      DLW-BPEX
                        

                      Thanks, Phil.

                      I hope that is not strictly the case. According to the help file, "In Instant Web Publishing and Custom Web Publishing, script triggers can only be activated by a script and not by direct user interaction. For example, if a user tabs into a field that has an OnObjectEnter script trigger, the trigger will not activate. If a script step causes focus to move into that field, the script trigger will activate."

                       

                      So I would think that, for example, a trigger set to OnLayoutLoad would activate if the layout loads as a result of a Go To Layout script step; yet it would not activate if that layout were selected from the layout menu. Does that sound right? (I am a ways from being ready to start testing this solution in IWP.)

                       

                      Your second point -- the caveat -- is very prudent.

                       

                      Any thoughts on my initial question about container fields and IWP with the drag-and-drop techniques posted earlier? (I'm afraid I probably know what the situation is.) 

                       

                      Thank you.

                      David

                       

                      [After posting, I realized that your previous reply answers this, at least as it relates to user-initiated triggers.] 

                      • 8. Re: Moving items in a list
                        mattb
                          

                        Mr. Vodka:

                         

                        >This is slightly advanced, but take a look.

                        >

                        >http://www.excelisys.com/web/downloads/files/Drag-and-Drop.zip

                         

                        Thanks for this.  I downloaded it last week and studied up.  Finally was able to implement it in my app and it works.

                         

                        However...this may be asking for the impossible, but let me explain my situation:

                         

                        I'm a Visual Foxpro developer rebuilding a commercial app for OSX people using FMP.  In VFP they have "listboxes with mover buttons" as

                        a pre-built screen building toolbox item.  I've been using FMP for all of 2 weeks, by the way.  Never used it before, but I have 20 years

                        of programming experience with VFP, so I'm a fairly quick learner.  

                         

                        I put the question out here of how does one go about creating listboxes which will move a record pointer and display data when list

                        items are clicked.  I got a very good answer about using portals with the Go To Related Record button and that worked fine.  But

                        there was no way to move the list items around with mover buttons.   When I implemented the Excelisys Drag and Drop code in my app

                        with this existing listbox, it disabled the GTRR action, because implementing the D & D required that the table that's associated with

                        the layout is a "Main" table.  By associating the layout with this Main table, that allowed the D & D work, but it broke the connection

                        to the GTRR action because that required the same layout to be associated with a different table.  Does this make sense?

                         

                        Anyway, to solve that conflict of interest, I created a separate portal in a separate window to implement the D & D, and placed it

                        side-by-side with the other window containing the "GTRR" portal, and damned if it doesn't work.  It works exactly as it should.

                         

                        But...from an interface point of view, it seems to me there must be some kind of way to have the D & D and the GTRR simultaneously

                        functional on this single listbox in one layout instead of 2.  It works that way in VFP anyway... 

                         

                        Your thoughts would be appreciated.  If you need any clarification, just ask.

                         

                         

                         

                        Matt Bloomfield

                         

                         

                         

                         

                        • 9. Re: Moving items in a list
                          mrvodka
                            

                          PhilModJunk wrote:

                          Web publishing doesn't support script triggers.

                           

                          Another Caveat to consider, since this is "...unexpected behavior that even those at FMI were suprised about", there's no guarantee that it will work in a future release of the database.


                          Yes but considering that it has been very successful, although there is no 100% guarantee, it is rumored that it will remain this way at least for a while. ;-)


                          • 10. Re: Moving items in a list
                            philmodjunk
                               Frankly, I'd like to see some specific drag and drop related script triggers added to a future version of the application. Right now, drag and drop can be used to modify a field without triggering the On Enter and On Modify triggers in some situations and this can leave a undesirable "loophole" in our interface design.