2017

Jun

13

Av

Have you ever wanted to sort the values of a value list by a third field, or been annoyed that value lists don’t handle non-indexed data? Maybe you sometimes wished it was possible to group data or to have the value list filter when you type characters, instead of jumping? I have!


I have been thinking about a solution to replace the native value lists with a custom and more flexible way. With FileMaker 16′s new Card Window it is now possible! This is a fairly bold idea, I know, but i think I’ve come pretty far.
I presented my technique for the first time at .fmp[x]Berlin 2017 and as I had hoped, the participants and I had an interesting discussion and came up with new features and ideas. Thank you guys for your collaboration!

FlexibleValueListsGrouped

How does it work?

When you enter the field, the script fires with name of the source layout as a parameter. It switches to that layout and sets variables from the text objects. Then it calculates the width and position of the field and opens a card window below the field.  In the card window, it processes the data in the source layout and saves it in a variable. The last thing it does is changing to the value list layout and sort it. While the card window is open, it listens for keyboard input and filters the list by the characters that the user types.

There is instructions in the database how to use it.

FlexibleValueListsImages

 

You can implement the Flexible Value List in your own solutions with help of the sample file (see below).

Features:

  • Sort values by a third field
  • Group values by a third field
  • Handles unindexed data
  • Just as quick as native value list to implement
  • Easy to implement in a completely new database
  • Easy to filter list using FileMaker search logic
  • Works like a native value list with keyboard input
  • Change design quickly in one place
  • Easy to change settings with variables in layout
  • Use native value list as data
  • Show images in the list

The features I want to implement in the future:

  • Show limited value list based on ID
  • Show checkbox instead of highlighting the value with colour
  • Five recent values on top. Last chosen values saved in a table (thank you Peter Kraaijeveld)
  • Five recent values on top per session/user
  • Specify list height in rows
  • Animated display in Go
  • Handle different languages
  • Hide ID field and only show list value (thank you Paul Jansen, APJ Ltd for the idea)
  • Option to enable more info with tooltip when hovering a value in the list
  • Option to cache the list to handle many values
  • Make it possible to add new data to the list while opened
  • More..? Any ideas? Make your own changes!

Limitations:

  • This solution will not work in WebDirect because it does not support cards. I hope that FileMaker will change that in the future.
  • It’s not possible to dismiss the list by clicking outside of window

Ongoing project

My idea is to update this post with new versions so it could be the source of the latest code. I would be very happy if you could send me an e-mail if you add features to it!

A video how it might look like when changing from a native value list to a flexible:



Download database here: Flexible Value Lists.fmp12

6 kommentarer till ”Flexible Value Lists”

  1. Robert

    Suggestion – add a Go to Field () script step to the Close script – after Close Window

    Reply
    • Robert Samnegård

      Don’t you mean Go to next field to replicate the native value lists behaviour? Or maybe you have another idea in mind?
      Thank you for your input!

      Reply
    • Robert Samnegård

      You’re welcome! Please let me know if you make any cool improvements of it!

      Reply
  2. Tom Fitch

    Very nice idea. It does feel like it needs a way to cancel without forcing me to choose a value. E.g., maybe add a top navigation part to the card layout and add a cancel button there, or use the built-in card/close option.

    Reply
    • Robert Samnegård

      Agreed! You’re not the first to point that out :-)
      The reason it’s not there is that I thought it didn’t look good and that the native value lists doesn’t have it. It is possible to close with escape button but a navigation part with a close button would be good especially because it’s not possible to dismiss the card window clicking outside of it.
      Thank you for your input!

      Reply

Skriv en kommentar

  • (will not be published)
  • 9 × eight =

Läs också: