Jump to content
Server Maintenance This Week. ×

GoTo Tab Control scripting?


This topic is 6734 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I know that, but i think is not the same thing…

the problem is:

In case of the field A exists in all TABs?

who scripting that without create empty fields?

Link to comment
Share on other sites

This seems like bad object-oriented design. You should be able to navigate to a tab object based on it's ID, not the identity of what it holds...

I can imagine cases where you'd have multiple tabs all containing the same fields.

For example, if you were using a tabbed design to switch between view and edit modes -- you'd have the same fields on both tabs, but in one case they'd be editable and in the other case, view only.

I can also see how this could make scripting difficult -- if you have a script that switches tabs, that script shouldn't have to know what fields are on the tab.

This just encourages poor design. Not a big deal, but one of those little details which makes maintaining a filemaker database more difficult...

EDIT: i suppose an advantage is that it's backwards-compatible somewhat with FM7, but still I'm not sure that's worth it for the compromise...

Edited by Guest
Link to comment
Share on other sites

Use repeating fields.

Create a bogus field, gvar1, set it to repeat to the number of tabs you have. Use Go To Field, with repitition set on whatever tab you want to go to.

Lock the field out, however you want, for this example I just made the point size 6, and have "go to next field" after i hit it. Of course this doesn't work, because I only have one field on the layout, but you get the idea. Notice on tab 5 that my field is extremely small in the top left hand corner of the tab.

There is a way to get the current tab, but I haven't used Repeating fields enough to know how to do it. I assume it has something to do with get repitition count of the field, but I'm not sure.

TabNav.zip

Link to comment
Share on other sites

It looks like you can't associate a script with a tab panel, either... this is too bad -- it would be really handy to have a script run when the user switches tabs (before the switch actually happens) -- you could then do permissions checking and switch them back to the other tab if they aren't allowed... Sigh.. So close to being what i want, but just not quite there.

FileMaker 8 -- the big tease :

Link to comment
Share on other sites

Here you go.

I am calling a script for each tab that is selected. I also have manually changed the text format for the selected tab to make it color, I'm sure there is an easier way to do this, but I haven't figured it out yet.

However, I am changing tabs with 1 script every time. The script is called by clicking on the tab.

I used Portals as my tab headers/buttons. Just a portal from a navigation table. 5 of them (For the 5 tabs) each showing one record (which record goes up every time. When the click on the field that is over the actual tab, it changes the tab and runs the script.

TabNav.zip

Edited by Guest
Link to comment
Share on other sites

Has anyone done some testing with the TAB control were you may have one or more portals on each tab and all the portals contain large amounts or records. Is the data of all the portal's pulled at the same time when the layout is displayed or are they pulled when you click on the individual tabs?

If they are loaded at the same time this could cause some slowdown when viewing layouts that may have a lot of tabs.

Link to comment
Share on other sites

When the click on the field that is over the actual tab, it changes the tab and runs the script.

I have looked at your file, to see if that is true. Because I found that if a button is placed inside a tab, the first click merely switches the tab panel, and does NOT activate the button. Only AFTER the tab panel has become active, you can click on the button. That is how your file behaves here, too.

Link to comment
Share on other sites

Tab controlled interface is a SPACE SAVING feature. This allows you to reduce layouts in order to maximize screen real estate in order to fit all your information on to one layout.

If your solution requires navigation/validation and other interface requirements it is recommended that you use established community techniques.

Link to comment
Share on other sites

If your solution requires navigation/validation and other interface requirements it is recommended that you use established community techniques.

Does this mean that the recommended way to navigate from layout to layout is the same as before? That is, create a set of graphics for tabs and navigate by scripts? Or is there a simple way to employ the new tab panel to do that, too?

You may do this when leaving the layout or when accessing the Layout, although, as you pointed, there is no other controls on the Tabs, thus moving from one Tab to another...

Link to comment
Share on other sites

Hi Mike,

Question was :

"I need to know what tab number the user is on when they click a button outside the tab control."

If it is outside the Tab Control, and if you use that repeating global field splitted in each Tab Layer, then you can use a loop involving Next Field and stop the loop when Get ( ActiveFieldName ) = "globalRep", then capture its content...

A GoToField wouldn't work, a loop through the tabbed field, although not esthetic would.

As for the Tab scripting itself, why would you like absolutely to put the button on to the Tabs themselves ?

Test

Edited by Guest
Link to comment
Share on other sites

Yes, I see what you mean. But if the user happens to be in a field, you should also try and take him/her back there. This is all too clumsy for my taste.

I believe Stephen is right: you should not treat tab control panels as separate layouts. The question 'in which tab panel am I' is the same as "am I now in the top half of the layout or the bottom one'.

Link to comment
Share on other sites

I have looked at your file, to see if that is true. Because I found that if a button is placed inside a tab, the first click merely switches the tab panel, and does NOT activate the button. Only AFTER the tab panel has become active, you can click on the button. That is how your file behaves here, too.

Ahh yes, I see what your saying, and notice that you are correct. In my excitment I must have dropped the ball here, sorry all.

Link to comment
Share on other sites

I know that, but i think is not the same thing…

the problem is:

In case of the field A exists in all TABs?

who scripting that without create empty fields?

Make one-to-one relationships for a field that exists on all tabs. Then when you use GoToField step, specify that field with it's corresponding relationship.

See Example - it's fast and dirty but it works.

I'm thinking of using similar techniques to direct users to different tabs in the record based on their department (ie sales to the Sales spec tab, Creative to the time tracker tab, shipping to shipping etc). In my case, there are relationships between all of those that refer to a common field, so it's pretty much cake.

hth,

Tony

Tab_Sample.fp7.zip

Edited by Guest
Link to comment
Share on other sites

  • 4 weeks later...

But why? I find all these solutions, honestly - stupid. FileMaker 8.01 should have a fix for both Tab scripting and calculated naming. This is such a hot topic, I can not believe the geniuses at FileMaker missed this one. How can it possibly be such a robust cross-platform product with such a MAJOR oversight? Bizarre...

Anyway, I must agree with the others who recommend NOT using a hair-brained trick to make it work. Eventually you will encounter a problem or simply have a poor design.

Link to comment
Share on other sites

Haha. I just saked him the same question to him the other day privately.

Ugo stated: "Take a look at Iconexperience.com where I purchased them."

Link to comment
Share on other sites

  • 1 month later...

But why? I find all these solutions, honestly - stupid. FileMaker 8.01 should have a fix for both Tab scripting and calculated naming. This is such a hot topic, I can not believe the geniuses at FileMaker missed this one. How can it possibly be such a robust cross-platform product with such a MAJOR oversight? Bizarre...

I can't help but agree. It is utterly moronic that I have to script ANYTHING to simply navigate back to the tab I was looking at when I left a layout and then came back. No doubt this will end up being one of FMP 9's chargeable "features". :

Link to comment
Share on other sites

A lot of what Filemaker does starts out as half-baked, and I do love to complain about them. However, version 8 is a super improvement over things past. Its not perfect, and version 9 surely won't be. No software product is perfect, nor will it suit everybody.

Steve

Link to comment
Share on other sites

This topic is 6734 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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