7 Replies Latest reply on May 17, 2010 1:13 PM by raybaudi

    Clicking a tab of a tab control does not 'activate' object (working with trigger OnObjectModify)

    arnoldkegebein

      Summary

      Clicking a tab of a tab control does not 'activate' object (working with trigger OnObjectModify)

      Description of the issue

      This might not be a bug but an intentional feature. But this behavior creates problems when working with object triggers like OnObjectModify. FileMaker Product(s) involved:FileMaker Pro 10 + 11 Operating System(s) involved:Mac OS 10.5.8 Detailed description of the issue:If a script trigger OnObjectModify is attached to a tab control, then clicking a tab will activate the trigger. But the function Get( ActiveLayoutObjectName ) used in the trigger script will not return the name of the tab object, even when all tabs have their individual object names. Actual, clicking a tab will not activate the tab control like moving the object focus with the tab key would do. Still, there is an object, that fires a trigger, but I cannot get the objects name. This behavior is kind of understandable, because not the trigger is not assigned to each single tab but the tab control. Unfortunately, you cannot assign an object name to a tab control, only to each single tab. Exact steps to reproduce the issue:Create a tab control with at least two tabs, giving all tabs individual object names.Assign a trigger script for OnObjectModify to the tab control object.The trigger script should include a step: Show Custom Dialog [Get ( ActiveLayoutObjectName )]In browse mode click on the tabs.Expected Result:The object name of the clicked tab should be shown in the dialog box. Actual Result:The dialog box is empty. Any workarounds that you have found:None. Possible solutions in future FileMaker versions:A build-in function Get( TriggerObjectName )Allow the naming of tab control objects (not only the individual tabs)Activate the tab object when clicked on it. 

        • 1. Re: Clicking a tab of a tab control does not 'activate' object (working with trigger OnObjectModify)
          raybaudi

          Hi

           

          clicking on a tab doesn't make that tab active, so there is not an active object.

           

          But there is an "IsFrontTabPanel" that you can catch with the logical function GetLayoutObjectAttibute ( )

          • 2. Re: Clicking a tab of a tab control does not 'activate' object (working with trigger OnObjectModify)
            arnoldkegebein

            @Daniele (raybaudi)

             

            Thank you bringing my attention to the "IsFrontTabPanel". I am actual aware of this feature and wrote a cf to eliminate the brackets and return all cascaded tab object names. But my 'problem' is, I have to work with object script triggers without knowing which object activated the trigger script.

             

            Of course, I can think of an elaborated workaround:

            1. Give the tab control object an 'imaginary' object name. I cannot actual create that name in FM, but in my documentation I will give it a name.
            2. When assigning the script trigger for the tab control, include a script parameter with this object name.
            3. Inside the trigger script, get the script parameter (perhaps extract the object name in case I provide multiple script parameters) and take it as the 'active' object name.
            4. Use the 'active' object name and use it with my cf frontTabs to get the actual clicked tab object name.

             

            The seen behavior breaks the user expectations:

            • Click an object will activate it.
              I click in a field, the focus is taken from where it was before and the field will be activated;
              I click in a background window, the focus vanishes from the previous active window and the former background window is placed in front and will be activated;
              I click on a tab in a tab control, the focus is taken from where it was before, the tab page of the tab control is brought to the front - but the tab is not active?!
            • Okay, the state might be different. It is not "active" but "selected". But there is no function to get the "selected" object. With the introduction of script triggers FM added a new function Get( TriggerKeystroke ). Isn't there the need for a function Get( TriggerObject ).
            • Perhaps this issue is more a feature request than a bug report. But there is often only a thin line between it. The user expects a certain behavior, but it fails. Bug or feature?

            • 3. Re: Clicking a tab of a tab control does not 'activate' object (working with trigger OnObjectModify)
              raybaudi

              "Give the tab control object an 'imaginary' object name"

               

              If you give to each tab an object name, like 1, 2, 3..., you can use a calculation like this:

               

              Case(
              GetLayoutObjectAttibute ( 1 ; "IsFrontTabPanel" ) ; 1 ;
              GetLayoutObjectAttibute ( 2 ; "IsFrontTabPanel" ) ; 2 ;
              GetLayoutObjectAttibute ( 3 ; "IsFrontTabPanel" ) ; 3 ;
              ...
              )

               

              to obtain the name of the selected tab.



              • 4. Re: Clicking a tab of a tab control does not 'activate' object (working with trigger OnObjectModify)
                arnoldkegebein

                @raybaudi

                It does not work when you have multiple tab controls in the same layout. All of them have one tab in front. Still, you do not know which was the tab the user clicked.

                 

                With an "imaginary" object name, passed as the trigger script parameter, you could guess, at least.

                For example, use the tab control name in front of each individual tab object name:

                1. tab control: tabctrlA

                • tabctrlA_tab1
                • tabctrlA_tab2
                • tabctrlA_tab3

                2. tab control: tabctrlB

                • tabctrlB_tab1
                • tabctrlB_tab2

                Now I can use to tab control name to limit the number of possible tab object names.

                 

                Still, a not necessarily an easy way. And I doubt the average FM user will develop a solution like that by him/herself. Rather will they avoid using object trigger with tab control. One simple function could change that.

                 

                • 5. Re: Clicking a tab of a tab control does not 'activate' object (working with trigger OnObjectModify)
                  raybaudi

                  Arnold

                   

                  my reply was to the supposed bug described by the thread title.

                   

                  "It does not work when you have multiple tab controls in the same layout. All of them have one tab in front. Still, you do not know which was the tab the user clicked."

                   

                  ... but you can know which was the last tab the user clicked, even with multiple tab controls.

                   

                  I agree that FM inc can create a better way to manage the tab controls.

                  • 6. Re: Clicking a tab of a tab control does not 'activate' object (working with trigger OnObjectModify)
                    arnoldkegebein

                    Daniele

                     

                    I hope I do not offend you with my continuing contradictions. I just might be in a bad mood today because my vacation plans are threaten by volcano ash clouds and pilot strikes. :smileysad:

                     

                    > ... but you can know which was the last tab the user clicked, even with multiple tab controls.

                     

                    I do know which was the latest tab clicked by the user? How do I do that?

                     

                    • 7. Re: Clicking a tab of a tab control does not 'activate' object (working with trigger OnObjectModify)
                      raybaudi

                      AKegebein wrote:

                       

                      I do know which was the latest tab clicked by the user? How do I do that?

                       


                      may be that there are simpler methods but I have an example for you ;)

                       

                      raybaudi(at)libero(dot)it

                       

                      BTW the solution is simple...

                       

                      The script triggered by both Tab Controls has only one step:

                       

                      Set Field [ YourTable:: Last Selected Tab Name ; Get ( ScriptParameter ) ]

                       

                      and each Tab Control sets its own ScriptParameter, something like:

                       

                      First Tab Control:

                       

                      Case(
                      GetLayoutObjectAttribute ( 1 ; "IsFrontTabPanel" ) ; 1 ;
                      GetLayoutObjectAttribute ( 2 ; "IsFrontTabPanel" ) ; 2 ;
                      GetLayoutObjectAttribute ( 3 ; "IsFrontTabPanel" ) ; 3
                      )

                       

                      Second Tab Control:

                       

                      Case(
                      GetLayoutObjectAttribute ( 4 ; "IsFrontTabPanel" ) ; 4 ;
                      GetLayoutObjectAttribute ( 5 ; "IsFrontTabPanel" ) ; 5 ;
                      GetLayoutObjectAttribute ( 6 ; "IsFrontTabPanel" ) ; 6
                      )