1 2 Previous Next 18 Replies Latest reply on Jul 18, 2015 2:11 PM by krheinlander

    Showing the user that field content is being truncated?

    jgalt

      I have a portal that contains a list of company names. Some of the name are very long and are being truncated. It's not clear to the user that the name is being truncated because there is no visual indication, such as a "..." on the end of it.

       

      To resolve this issue I create a calculation field and pick the maximum number of characters that can be displayed.  If the content length is greater than truncate length I add a "..." to the end of the calculation.

       

      This is not a very good solution for two reasons. It requires me to clutter my solution with bunch of calculation fields (sometimes multiple calculations for the same field depending on how many different portals it is being displayed in). Secondly,  since the characters have different widths sometimes a field is truncated before it really needs to be.

       

      For example, these two companies are both 31 characters long:

       

      "Mississippi Indigo Indian Tribe"

      "The Research Center of New York"

       

      If I truncated the field at 30 characters the word "Tribe" would unnecessarily get chopped off.

       

      Does anyone have a better solution for dealing with this problem?

       

      What we really need is an option in the inspector that allows us to turn on some sort of truncated data indicator to make it clear to the user what is going on. An option that works independently of font size or style.

        • 1. Re: Showing the user that field content is being truncated?
          mikebeargie

          I use the "hide object when" calc to show a "...Read More" button on the end of long text fields, It overlays the right side of a single row field, but could also be used to overlap the bottom row of a multi-line field.

           

          The button enters the text box to show the full contents.

           

          No extra calculation field required, and the button can easily be made context free with a script parameter.

          • 2. Re: Showing the user that field content is being truncated?
            AlanStirling

            We all have different ways of dealing with this.

             

            My preferred option is to extend the field to the right, behind the field to its right and to set the field to its right to not be transparent.

             

            In this way the last word that normally doesn’t fit on the line, does not get wrapped, but shows as truncated by the left edge of the next field. This makes it obvious that there is some data hidden behind the second field and clicking on the original field will bring it all to the front and show multiple lines if necessary.

             

            No length calcs, just a bit of ‘Interfacing’.

             

            Best wishes - Alan Stirling

            • 3. Re: Showing the user that field content is being truncated?
              justinc

              Jgalt,

                 I think Mike has the right answer.  I might further suggest a simple ellipses graphic:  make a 'rectangle' layout object, for the 'fill color' pick 'image', pick whatever your prefered image file is.  Then you define the 'hide' calculation for that object.  It might get a bit tedious because you would have to do this for each object you wanted to put an indicator on, but then they are layout objects and not fields in the table.

               

              Or even just three periods in a text-object, or on a button (like Mike was suggesting).

               

              The calculation would look something like:

               

              Length (TableA::FieldName) > 30

               

              I'm not sure that there's a good way to take into account character spacing of the font-type.  There's probably some calculation you could do to convert each character into an actual 'width' value in points based on the font and font size, add all those up, and then use that in your 'hide' calculation.  But I don't know what that is. 

               

              --  J

              • 4. Re: Showing the user that field content is being truncated?
                jgalt

                Thanks for your replies guys. I am going to experiment with a combination of Mike's technique and trying to see if I can write a custom function that gives me a more accurate character width than simply counting the number of characters. If it works well I will post the solution.

                • 5. Re: Showing the user that field content is being truncated?
                  mikebeargie

                  You could probably get pretty heavy into things using GetLayoutObjectAttribute() to get the field width and height, and then estimating the size based on the content and dimensions.

                   

                  Would be nice to see a demo file if you come up with some cool functions.

                  • 6. Re: Showing the user that field content is being truncated?

                    I solve a problem similar by using two lines on the protal row and setting the formating to middle instead of top. Thus a name that fits on one line shows as center where as one that needs two lines shows both lines.

                     

                    One could also use a calculation to supply a text size based on character count so that the font size is reduced much like Apple uses in some applications.

                    • 7. Re: Showing the user that field content is being truncated?
                      Benjamin Fehr

                      I would go with  mikebeargie and the hiddenObject.

                      In addition, you could apply a Quickinfo though user can see entire text on hover!

                      • 8. Re: Showing the user that field content is being truncated?
                        jgalt

                        Who has the big brain? This is a little out of my area of expertise, but I think if I can make a custom function that can process all characters using a formula something like this I think it will return a more accurate character count as to where to truncate the text:

                         

                        UPPERCASE

                        ABCDEFGHJKLMNOPQRSTUVWXYZ  = (1)

                        I  = (.65)

                         

                        LOWERCASE

                        abcdefghjkmnopqrstuvwxyz  = (.85)

                        Il  = (.65)

                         

                        NUMBERS

                        1234567890  = (1)

                         

                        MISC CHARACTERS

                        @#$%^&*_+=\?/<>~  = (1)

                        !()-{}[]|:’”,.`  = (.85)

                         

                        SPACES  = (.65)

                        • 9. Re: Showing the user that field content is being truncated?
                          BruceHerbach

                          I usually don't worry about this in a portal or list view.  I do set up the tool tip to display the whole field.  Just enter the value self into the tool tip.  So when the user puts the mouse over it, it displays the full name.

                           

                          I also make the client aware of this.  Once shown how to get the full value with the tool tip my clients have been happy with this.

                           

                          Admittedly this doesn't work well in Go.

                           

                          On a Detail layout I try to make sure the full name can be seen and or entered.  Which sometimes means having a large field on the layout

                          • 10. Re: Showing the user that field content is being truncated?
                            siplus

                            it's overkill.

                            It's just there to demonstrate an idea, and the fact that Filemaker got the power.

                             

                            Still, take a look.

                             

                            The idea is the following:

                             

                            1) you have a fixed length (in pixels) real estate on the layout for a field; you want to display the contents as aabbbcc if it fits and as aaabbbccc... if it does not.

                             

                             

                            2) by using an array, which has a layout-adjustable width and a define fields-adjustable repetitions, you establish, depending on the font and size and how much space you have, the dimension of  the calibrator array in define fields, from the 15 repetitions it has now to whatever.

                             

                            It will allow a fixed width for every char it contains, the width of the repetition field's instance.

                             

                            You calibrate it by using lots of M in the original field.

                             

                            You should get the idea.

                            • 11. Re: Showing the user that field content is being truncated?
                              Benjamin Fehr

                              I checked your file just out of curiosity. Didn't know that this works,

                                   if (theTxtArrayListControl; "…")

                              when field is boolean as 0 OR 1

                               

                              • 12. Re: Showing the user that field content is being truncated?
                                jgalt

                                siplus wrote:

                                 

                                by using an array, which has a layout-adjustable width and a define fields-adjustable repetitions, you establish, depending on the font and size and how much space you have, the dimension of  the calibrator array in define fields, from the 15 repetitions it has now to whatever.

                                 

                                Thanks for the demo file siplus, but I just don't understand the benefit that this technique provides. No matter what I type your "theTxtDisplay" field only displays a maximum of 14 characters. I also do not understand the part about the "layout-adjustable width". I made the layout in your sample file adjustable, and also the array, and it still returns the same results. What am I missing?

                                • 13. Re: Showing the user that field content is being truncated?
                                  jgalt

                                  Bruce Herbach wrote:

                                   

                                  I usually don't worry about this in a portal or list view.  I do set up the tool tip to display the whole field.  Just enter the value self into the tool tip.  So when the user puts the mouse over it, it displays the full name.

                                  Thanks Bruce. I have never been too happy with using the the tool tips for this type of thing. On the Mac you must hover over it for a couple of seconds before it displays (I assume that this delay is deliberate and probably a good idea) but on Windows it pops up much faster, it seems like it takes less than a second.

                                  • 14. Re: Showing the user that field content is being truncated?
                                    BobGossom

                                    Hi,

                                     

                                    Lot's of good replies. It's worth a mention that conditional formatting can help with this issue. Fields with more than a specific length can be displayed in a smaller font. This doesn't solve the problem, but can help it to occur less often.

                                     

                                    Bob Gossom

                                    1 of 1 people found this helpful
                                    1 2 Previous Next