6 Replies Latest reply on Oct 13, 2015 4:38 PM by dtcgnet

    Keeping Button Bar Active

    TimBaker

      I'm having with the Specify Active segment of my button bars when trying to use them as a nicer UI version of checkboxes.  I have them set fine to edit the field when pushed, but on layout load the correct button does not activate. I've tried both the Case and GetField functions in the Specify active calculation to no success.


      I've attached a testing file I've been working with for reference (testing mainly with the Box Dimensions field, which I have an extra field box

      above for reference if that helps).

       

      Really appreciate any ideas, I'm sure it's something simple and small that I'm just glossing over.

        • 1. Re: Keeping Button Bar Active
          dtcgnet

          For the "Specify" calculation, try using this:

           

          Case (

          Inventory::Box Dimensions = "Small" ; "Small" ;

          Inventory::Box Dimensions = "Medium" ; "Medium" ;

          Inventory::Box Dimensions = "Large" ; "Large" ;

          Inventory::Box Dimensions = "No Box" ; "No Box"

          )

           

          Also, your individual "buttons" need to be named. You've got the values for the buttons set in your button bar. Now click onto each individual button. Go to the Inspector, Position tab. Name each button. FM will use those object names for your navigation.

          • 3. Re: Keeping Button Bar Active
            erolst

            dtcgnet wrote:

            Case (

            Inventory::Box Dimensions = "Small" ; "Small" ;

            Inventory::Box Dimensions = "Medium" ; "Medium" ;

            Inventory::Box Dimensions = "Large" ; "Large" ;

            Inventory::Box Dimensions = "No Box" ; "No Box"

            )

             

            How is that calculation different from the expression

             

            Inventory::Box Dimensions

             

            • 4. Re: Keeping Button Bar Active
              dtcgnet

              In that case...you're right. No real difference. I actually like user14047's method, where the objects are named a little more fully, too. Why? Because it's possible that Tim's database might actually have more than one instance of "Small", "Medium" or so on. Two objects can't have the same name on the same layout, so adding more information such as he identified would be preferable. For example, BoxSize_Small, LabelSize_Small.

               

              I can think of a time when a case statement would be better, such as if there are options such as Small, Medium, Large, Other (and any value besides Small, Medium, or Large would make "Other" the active button). Or if the user had a button called "Not Chosen Yet", where the value of the field would be empty and the proper button wouldn't highlight.

               

              But you're right...in my example...Inventory::Box Dimensions is better.

              • 5. Re: Keeping Button Bar Active
                erolst

                dtcgnet wrote:

                But you're right...in my example...Inventory::Box Dimensions is better.

                 

                Yes, it wasn't really a question; I just wanted to point out that the calculation as written was rather pointless … only to prevent any newbies from trying to glean hidden meaning or subtleties for hours on end, of course)

                • 6. Re: Keeping Button Bar Active
                  dtcgnet

                  True. I guess I missed an opportunity with the original formula.

                   

                  Case (

                  Inventory::Box Dimensions = "Small" ; "Small" ;

                  Inventory::Box Dimensions = "Medium" ; "Medium" ;

                  Inventory::Box Dimensions = "Large" ; "Large" ;

                  IsEmpty ( Inventory::Box Dimensions ) or Inventory::Box Dimensions = "No Box" ; "No Box"

                  )

                   

                  In the formula above, I underlined the new part representing a missed opportunity.

                   

                  If data in that field was important to the user, then a record for which no selection had yet been made would make the active button "No Box". If a setting of "No Box"--or no setting at all--was important to highlight, then a Case statement would work whereas a call to an empty field would result in none of the buttons being highlighted. Either way, I'd probably try to use conditional formatting or some other visual cue to alert the user that "some sort of box has not yet been selected".

                   

                  I love to see the ideas that various people use in their formulas. Always things to learn.