Drag-and-drop with FileMaker

We sometimes get requests from customers to implement drag-and-drop in our solutions, for selecting certain records, e.g. you want to select a nice beer and add it to you order. This week's example shows a simple technique to use drag-and-drop functionality to select a record and drag it to another record to create a link between them.

Drag-n-drop with FileMaker

The first thing you have to do is to give the images in the container the same name as the id for the record. So for record 1 we are going to store a picture with 1.png in the container field, for record 2, 2.png etc ...

Now we can use simple auto enter functions, to get the id from of the name of the container data.

Download the example file here.

2 Responses to “Drag-and-drop with FileMaker”

  1. coltom Says:

    Hi

    Would it be possible to explain what’s going on here in a little more detail? E.g., do you have to name each image 1.png, 2.png, etc manually? I can see how dragging the image onto the dropzone populates, via the filter fxn (i.e. 1.png becomes 1), the foreign key field and then how the ::image container field is populated but why doesn’t the dropzone container field also receive the same image? Also, how does one add more images to the Beer Selector as image_c can’t be modified as it’s a calculation?

    Hope you can help.

    Colin

  2. Koen Van Hulle Says:

    Hello,

    You can add new images/records by naming them manually.
    But of coarse a better way, would be to do this automatically.

    You can do this by writing a script that runs after an image was inserted into the field.

    With the script step “Export Field contents”, you can export and rename the image and then import it in the field again.

    You need to add the image in the field “image”. The calculation “image_c” was created to avoid users to overwrite the image in the drag-n-drop layout.
    To let the drag-n-drop work, the field must be accessible.

    If you want more advanced drag-n-drop functionality, you can also check the Fusion Reactor plug-in from Fusion Plug-ins.

    http://www.fusionplugins.com/reactor/

    I hope this helped to solve your problem.

    Koen

Leave a Reply

You must be logged in to post a comment.