Jump to content
Sign in to follow this  
aalrr1

Link a script to a tab

Recommended Posts

I have set up Tabs named by Position, i.e. Attorneys, Managers. The named tabs are part of the Header; the Body includes the lower part of the tab control. Each tab (built like a List) includes pertinent fields based on positon. The FoundSet is different for each tab. When the Attorneys tab is selected, I want only attorneys to display.

I put a transparent button on the tab to run a script for each tab. However, the user has to press the Tab twice before the script runs.

Is there a better way? Thank you.

Share this post


Link to post
Share on other sites

There are a few different ways to achieve this. The first way is to create fake tabs and attach scripts to them. Make the original tab control tabs hidden by using a fixed width of 0 pixels (there are posts on here about how to achieve this in further detail). Make sure you name each tab panel with an object name prior to hiding them so that you can reference them in your scripts using Go to Object.

Another method would be to use filtered portals for each of your different tab panel tabs.

Share this post


Link to post
Share on other sites

I would prefer using the filtered portals. However, am having problems. On a Form, I have 5 Tabs, 4 -- one each for a different group of people by Position from the same Employees table, and the 5th one for ALL employees. I have created 5 global fields (in the Employees table), one for each Position and the ALL category. I have related the global field to the Positions field (also in the Employees table) with a self join (duplicate) table.

All records are displaying on every tab. I'm new at this and pretty confused by this time. Any help would be appreciated.

Share this post


Link to post
Share on other sites

With this you will need 5 relationships. One for each of the global fields to the Positions field. Are you referencing the related self join for you portals?

Share this post


Link to post
Share on other sites

I also want to link script to a tab. I have a tab to view invoices and then one tab that I want to create a new invoice, one to view a certain type of invoice. I guess I'm having trouble deciding to make a fake tab. Or creating a filtered portal as mentioned here. The one tab panel I want to click and the same screen as the invoice screen comes up but a blank record. My customer likes the whole tab control thing.

Any help would be appreciated. I so wish I could attach a script to a tab panel.

Share this post


Link to post
Share on other sites

This example of onEvent programming requires myFMbutler DoScript (you can replace it with zippscript if you wish).

HTH

onTabFocus.fp7.zip

Edited by Guest

Share this post


Link to post
Share on other sites

I'm returning to this old topic. I also wanted to associate a script start (GoTo Layout nn) to one of the Tab Panel choices. It can possibly be done via script triggering in FM 10, but does it work in IWP ? If not, how can this be done ?

Share this post


Link to post
Share on other sites

So, I assume, it is not possible to link a tab control to a script. Or was this too stupid question to be answered ? :

Share this post


Link to post
Share on other sites

I think in this post, an actual tab panel is being confused with a design that mimics a tab panel.

In a real tab panel, the portal displayed in the panel must be a related child table. It could be a cartesian relationship. However, you cannot go to a different parent layout by clicking a tab panel tabs, without leaving the current parent layout.

A pseudo-tab panel is exactly that. Graphics added to a layout that looks like a tab panel. Another layout has these graphics in the exact same location, so that to a user it appears that they are on the same parent layout when they click between tab panels. This was actually how we all did tab panel interfaces before the "real" tab panel object was introduced in FM.

Here is a link to Geoff Coffey's technique for using Script Triggers with tab panels. Link

..and attached is an FM10 only demo file that uses Geoff's technique, modified from Fabrice's original.

onTabFocusScriptTrigger.fp7.zip

Edited by Guest
Added demo file

Share this post


Link to post
Share on other sites

Yes, that demo seems to be working the way I wanted, but it uses script triggers and I believe they don't work in IWP environment.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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