Drag and Drop Example for FileMaker Pro 7 - Part II

To begin, please download and open the example database.

Download the example file (FileMaker 7 required)

Drag and Drop Test...Part II

In part I of the drag and drop test we looked at having a field you can drop to, "active text", but still have the ability to type in the field. This effect is desirable if you want users to be able to drag ID keys to a field, but also be able to type them in as normal.

So what if we do not want the user to be able to type into the field? What if we only want the "active text" field to be a drop zone? That is where "Part II" comes in. If you have not already read Part I, you might want to read it first because it explains things more thoroughly.

Take it for a drive...

To test this out, type something in the "some text" field. The "some text container" field will update to what you just typed. Then drag the container field contents to the "active text" field. At this point, the "active text" field should remain empty, but the "active text unmodified" field should inherit the text that you dropped.

In order to be able to drag to the "active text" field, you have to be able to enter it, which also means you can click in it and type some text, however, the auto entered calculation mentioned bellow resets the field to nothing when the user clicks out of the field.

Also note that you can now drag from the "some text container" to the "active text unmodified" field and it will update with the text. You can also type in the field to change the value. Keep in mind that this field is not meant to be shown on a layout. Instead, use it as a relationship key which the user never actually sees.

How it all works...

As it turns out, there are only three modifications needed to make the first example work as desired.

1. Change the "active text" field so that it auto-enters nothing rather than the active field contents by using empty quotes. (Another method would be using the "Left" function on the "active text" field with the number of characters set to zero):

Let ( 

   [
      selftrigger = active text
   ];

   "" //Get ( ActiveFieldContents )

 )

2. Second, we need to adjust the "active text unmodified" auto entered calc to grab the active field contents rather than the "active text" contents, since it will now always be empty:

Let ( 

   [
      selftrigger = active text
   ];

   Case ( Get ( ActiveFieldName ) <> "active text" ; Get ( ActiveFieldContents ) ; active text unmodified)

 )

The only difference between the calculation above, and the calculation from part I is that Get ( ActiveFieldContents ) was "active text" without the quotes.

3. The last bit of the puzzle need: uncheck "Do not evaluate if all referenced fields are empty" in the auto entered calculation for the "active text unmodified" field. This forces the field to update even though there is nothing in the "active text" field.

Conclustion

So there you have it, yet another way to using drag and drop in Filemaker 7. I am betting there are a few other ways too.

Enjoy -

Jesse Traynham.


P.S. You may also want to take a look at Jonathan Mickelson's drag and drop examle at
http://www.thought-dev.com/fmexamples/Drag_n_Drop_Example.fp7.zip

...more entries
<- September 2010 ->
S M T W T F S

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30


Jesse.Traynham.com
π