YaY! Thanks Tom!
That did it exactly. As a Thank You, here is a little "Syntactical Candy" using this information. Pass in a Piped Array of the ObjectNames assigned to the Tab-Panels and you can use the following Function to return the Selected Tab's Object Name. If you know of some groovy way to Get the Array of TabObjectNames dynaically for a Tab Control "group" then this can be improved upon by generating the Array of TabObjectNames dynamically (or maybe even doing away with the need for a parameter). But for what I have found so far, this is the best I can do: ===================== //tabOjectName (pTabObjectName_par) // // par = "Piped ARray" // //RECURSIVE // Let ( [ vTabObjectName_par = pTabObjectName_par & Case(Right(pTabObjectName_par; 1) ≠ "|"; "|"); vTabObjectName_this = Trim(Left(vTabObjectName_par; Position(vTabObjectName_par; "|"; 1; 1) - 1)); vIsFrontTabPanel = GetLayoutObjectAttribute ( vTabObjectName_this; "isFrontTabPanel" ); vTabObjectNameRemaining_par = Right(vTabObjectName_par; Length(vTabObjectName_par) - Position(vTabObjectName_par; "|"; 1; 1)) ] ; Case(vIsFrontTabPanel = 1; vTabObjectName_this; IsEmpty ( vTabObjectNameRemaining_par ); ""; tabObjectName(vTabObjectNameRemaining_par)) ) ===================== (bug reports and enhancements welcomed...) Thanks again Tom, I hope you (or someone) finds the function useful, Brad On Fri, Aug 14, 2009 at 11:35 AM, Tom Elliott <[email protected]>wrote: > Brad > > GetLayoutObjectAttribute ( <objectName> ; "IsFrontTabPanel" ) should enable > you to do what you want, but rather than being able to capture the front > tab's name directly, you have to check each name in turn. > > cheers > > Tom > > > On 14 Aug 2009, at 16:50, Brad Lowry wrote: > > Hi All, >> >> I think I must be missing something simple (I hope). >> >> (FM10.0v3 Advanced) >> >> So I can create a Tab Set with tabs "Tab One" and "Tab Two". >> >> In layout mode I select each tab and give them Object Names of tab1 and >> tab2 respectively. >> >> I can create a test button, Go To Object (tab2), that behaves as expected. >> >> Then, when I right-click on the tab and choose Set Script Triggers -> >> >> Then select "OnObjectModify" and assign a Script (enabled in Browse)-> >> >> Back in Browse mode if I click on Tab Two the Script Trigger I set up will >> indeed run. >> >> However, the same script runs regardless of which tab I select! >> >> Why does each Tab have the ability to have an ObjectName (and behave as >> such for GoTo Object), however, when you click on one of the tabs the >> ActiveLayoutObject (either as a script parameter, or in DataViewer) is >> empty? Indeed, the Tab Control Tool "overall group" seemingly cannot have >> its own ObjectName assigned to it, yet that seems to be the Object that the >> OnObjectModify call is "listening" to. >> >> I went through all the Get() functions [in Particular Get(TriggerAction) >> and Get(TriggerModifierKeys)]and there were none that seemed to do the >> trick. >> >> Is there an easy (and still elegant) way to attach a script to a tab >> navigation where *which* tab (as ObjectName or other capturable value) can >> be isolated and used as a parameter? >> >> I really would have expected that clicking a layout object (including >> specific tabs) simply made it the "active" one. >> >> I would have expected two additional things: 1) for Script Triggers I >> would have expected an "OnObjectClick" (since Click isn't really the same as >> Modify); and 2) in the Get() functions I would have expected >> Get(ObjectClicked) [especially if it really is meaningfully different than >> "active"]. But these two things would be Gravy if there is some other State >> Attribute I can gather as a Parameter for the OnObjectModify Script Trigger >> that is specific to the Tab being selected. >> >> This was my preferred MO with FM6: customary multi-layout "tab effect" was >> accomplished with many layouts and tab buttons that were "GoToLayout" >> buttons. Almost immediately I went with each button calling a script that >> was (before button/script prameters) "GoToLayout1", "GoToLayout2" and so on. >> When the only step was "GoToLayout(Layout1)", the extra effort of writing >> the script would be wasted since the effect was equivalent. However, as the >> application got more complex (as applications always seem to do), I was >> almost always calling some validation script, some access privilege test, >> some referential integrity check or whatever along with the simple >> GoToLayout. >> >> Don't get me wrong, I love the whiz-bang Tab Control Tool and the new >> Script Trigger feature, but I am tempted to do it the "old fashioned way" >> for lack of scripting upon tab selection for a Particular Tab. >> >> With Script Trigger and a Tab being an Nameable LayoutObject I thought >> that frustration was going to be a thing of the past. I hope I wasn't wrong! >> >> Thanks in advance for any assistance. >> >> -- >> Sincerely, >> Brad >> > -- Sincerely, Brad
