10 Replies Latest reply on May 2, 2014 11:50 AM by FMProFan

    How to color active row's datas ?



      How to color active row's datas ?


           Hello there,

           With the new FileMaker 13, it is now easy to indicate clearly where is the active row in a list view, using the new state "Active", on the style appearance of body part.

           But if you chose for instance a dark or contrast fill color, it would be nice to also change the font color of the fields inside the body part.

           It can seem obvious to use conditional formatting to do that. But i cannot find the appropriate formula.

           I tried different combinations like for instance, placed a {{RecordNumber}} named "ObjectName" on footer, that return correct result and compare it using Get (RecordNumber) = GetLayoutObjectAttribute ( "ObjectName" ; "Content" ) on conditional formatting formula, but with always the same results. That is, all records return true, and all rows being colored.

           It sounds like conditional formatting is not the correct way to do that. Do you know another way, reliable and elegant ?

           For example, on the screenshot below, how to define "white" and "bold" for display data of active row ?

           Thanks in advance...

           Bye, Fred


        • 1. Re: How to color active row's datas ?

               The example here

          • 2. Re: How to color active row's datas ?

                 You can also specify a different text style for your active portal row in the Inspector's appearance section.

                 I layout mode, select the portal, then go to the Inspector's appearance tab and select "portal row" from the upper drop down, "active" from the lower one. Then scroll down on inspector to the text section and select your desired font and style for when the row is the active row.

            • 3. Re: How to color active row's datas ?

                   Thank you !

                   Maybe (surely) my description was not very clear : I principally talked about body part on List view.

                   But yes, with portals also, the solution have the same interest !

                   However, what you are stating don't work on my FileMaker copy : modifying on the text section is not allowed (greyed out) when i select "portal row".

                   And i can understand it : each object can have his own text attribute. What am i missing ???

              • 4. Re: How to color active row's datas ?

                     Hi ! I told Fred I would join this discussion, here am I. My issue is rather close to his one - how to conditionally change or mask elements of the layout depending on record activity status.

                     I understand from the discussion that I can customize the way to highlight the active row of a list format. However, I am not entirely satisfied. I am looking for long for a way to display or mask specific objets (graphics or data fields) in a list, depending on wether or not the record is active.

                     I thought the new FM13 function "Mask when…" (in French, "masquer lorsque…") would fit. Seems it is not the case, the information "active object" is not available to feed the function. Or, more honestly, I could not find it.

                     Hope my English words fit, I am not familiar with the specific English vocabulary for Data Basis.

                • 5. Re: How to color active row's datas ?

                       Sorry Fred, I mistook your original image for a portal.

                       The text formatting options, unfortunately, but not surprisingly are not available for the body layout part.

                       But you can use conditional formatting to style the text in the active record:

                       In the List layout of my Known Bugs List Database, I have the OnRecordLoad script perform this script:

                       Set Variable [$$RecordID ; value: Get ( RecordID ) ]
                       Refresh Window []

                       Then I can use this expression in a conditional format:

                       $$RecordID = Get ( RecordID )

                       to change the fill color, text color or text style of fields or layout text present in the active record.

                  • 6. Re: How to color active row's datas ?

                         And FileMaker 13's "Hide Object When" setting could use the same expression provided that you use the same OnRecordLoad performed script.

                    • 7. Re: How to color active row's datas ?
                           Hi Phil,
                           Your idea is working fine indeed yes.
                           I only experienced a little bug, one time, when i opened multiple windows. Then, i remembered a tip which i learned from David Jondreau, that allow to index the global variable on the the window's name (that must be unique) : $$RecordID[ Code ( Get ( WindowName ) ) ].
                      And fortunately, the two techniques are working fine together !
                      Thank you very much, Phil !
                      Bye, Fred
                      • 8. Re: How to color active row's datas ?

                             Hi Phil,

                             At first, I had to understand that "layout" means "Format de Modèle". "List layout" means "Format de Modèle de Liste". So, I entered my List layout design and immediately found "onRecordLoad". A door just opened ! And this was already available in FM 12 !!! Shame on me !

                             I wonder wether I absolutely need the conditional masking function, I guess I can find a solution, but this may be tricky. So, this seems to be the good news in FM 13

                             Thanks a lot, Phil !


                        • 9. Re: How to color active row's datas ?

                               If I need an object to appear and disappear from my layout, "hide object when" seems a far simpler option than the alternatives I"ve had to use in previous versions.

                          • 10. Re: How to color active row's datas ?

                            idée Indeed !!! Thanks a lot, once more !

                                 I have dreamed of it for years...