Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Action depending upon tab selected

Featured Replies

Alright, I need some help. I read up on it and searched and I am still stuck. I have three tabs. Layout opens on default tab 1. If I select 2 or 3 I want script to run and script to run if returning to tab 1 but not if clicking tab 1 if they have never gone to 2 or 3. So I named them 1, 2 and 3 using the object name and I was thinking of something like this...

If[ GetLayoutObjectAttribute( "2" ; "hasFocus" )

set variable $$left1 to "2"

perform sub script [script #2]

Else if GetLayoutObjectAttribute( "3" ; "hasFocus" )

set variable $$left1 to "3"

perform sub-script[script #3]

else If[ $$left1 > 1

set Variable[ $$left1 to "" ]

perform sub script[script Verify]

In testing, script has only Show Custom dialog[ GetLayoutObjectAttribute( "2" ; "hasFocus" ) and it should give me a 1 if I go to tab 2 but all I get is 0 no matter what I try. None of them work. In reading, it seems it should work.

Please advise if I posted in wrong section and I will try to move it but it seemed most appropriate. And if you need more information I can provide.

I think you want to use "isFrontTabPanel" instead of "hasFocus".

  • Author

Oh. I see. hasFocus seemed to fit. I thought isFront would say which was default tab. It says, "isFrontTabPanel - returns 1 (True) if the target object is the tab panel that is in front." I did not test it but I see now that it works like I want and it isn't just telling me which is the front default tab. Thank you.

Just for my understanding can you explain how hasFocus might be used? It says it can be used with tab panels but if it isn't saying the tab is selected then what might it mean? I thought 'focus' meant selected, like in windows.

Edited by David Nelson

  • Author

And while here, may I ask another question? At the bottom of the layout when I am working, each part is named, heading, body. But those names make it impossible to put fields there because I can not see labels to move them nor can I see fields if small. I am beyond frustration with the body tab and I want to make it disappear or move it to the other side so I can see when placing things in that left area. Possible?

This forum is sure nice improvement from the one on filemaker website.

"hasFocus" does mean "selected" or "active" - i.e. contains the cursor. AFAIK, the only way to make a tab panel active (in Browse mode) is to include it in the layout's tab order, then tab into it.

To toggle part labels between horizontal and vertical, use the button at the bottom of the window (next to the mode selector).

  • Author

It has taken me a while to study all of these pieces. Thank you for explaining, it is good to know the difference. And my tabs are all working great but I realize I have wrong structure and need to remove all 128 tabs (10 tabs with 28 tab panels within each) I just built. Funny. I keep reading things from which I learn that I would have done it wrong if I had gone ahead before learning it. I am inclined to tie my hands so I do not work on it and only focus on test files for at least six months more.

About the layout labels - I swear I have clicked that icon many times and could never figure out what it did. This is perfect example where a designer (FM) has put an icon on a layout and the person does not know what it means. Maybe FM should be reminded to use tooltips. What would you call this thing (layout tab?) so I can look it up or make suggestion to FM?

Thank you again for your assistance.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.