dbTalk Databases Forums  

Can I set a variable based on the selected tab?

comp.databases.filemaker comp.databases.filemaker


Discuss Can I set a variable based on the selected tab? in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
GSteven
 
Posts: n/a

Default Can I set a variable based on the selected tab? - 12-17-2009 , 12:10 PM






I have a layout with multiple tabs on it showing records from a contacts
table. There are multiple contact types - ie vendors, employees and clients.
When I select the tab labeled "Vendor" I would like to populate a field used
in the relationship into contacts so that only the vendor types are shown in
in the portal.

It's easy enough to name the tab control objects by the name of the filter
to apply but I cannot figure out how to get the object name into the
relationship field. BTW - I guess that I could use script triggers except
that this app is going to be served via IWP and I don't think they would
work.

Reply With Quote
  #2  
Old   
jahn
 
Posts: n/a

Default Re: Can I set a variable based on the selected tab? - 12-17-2009 , 12:52 PM






If the portal is inside the tab area, you could define three separate
relationships -- one for each tab -- so that only the relevant records
appeared on in each portal. Alternatively, if it's outside the tab
area, you could increase the size of the tab control panel to
encompass it and then define three different relationships as in the
first option.

A third method would be to set the tab width to zero pixels and use
buttons instead of tabs to navigate from one to the other, assigning a
go-to-object script to each button. By doing this, you could include
a script step that sets your filter field with the appropriate value
and commits the record so the relationship takes in a hosted
environment. I'm not sure what's IWP-compliant since I've never used
it, but I think these methods should work.

-J.

Reply With Quote
  #3  
Old   
105
 
Posts: n/a

Default Re: Can I set a variable based on the selected tab? - 12-17-2009 , 02:57 PM



GSteven wrote:
Quote:
I have a layout with multiple tabs on it showing records from a contacts
table. There are multiple contact types - ie vendors, employees and clients.
When I select the tab labeled "Vendor" I would like to populate a field used
in the relationship into contacts so that only the vendor types are shown in
in the portal.

It's easy enough to name the tab control objects by the name of the filter
to apply but I cannot figure out how to get the object name into the
relationship field. BTW - I guess that I could use script triggers except
that this app is going to be served via IWP and I don't think they would
work.


FileMaker. Who would have thought a an object that can be given an
object name, isn't an object in terms of Get ( ActiveLayoutObjectName )




Go to Object
Purpose
Moves to the specified object on the current layout.

Object
On a FileMaker Pro layout, an object is a discrete entity or shape that
you can select, move, modify, delete, or name. Lines, fields, buttons,
portals, imported graphics, blocks of text, tab controls, and web
viewers are objects.

<<<
LayoutObjectNames
Purpose
Returns a list of the names of all named objects on layoutName in
fileName, separated by carriage returns.
Quote:

Get(ActiveLayoutObjectName)
Purpose
Returns the object name of the active layout object in the calculation's
current window; otherwise, returns an empty string.

Examples
There is a named button on the current layout called cancelButton. When
the focus is on the button, Get(ActiveLayoutObjectName) returns
cancelButton.




OnObjectEnter
Triggers a script to run when a layout object becomes active as a result
of the following:

a user tabs to the object

a user clicks the object

a script step causes an object to be entered

a user moves between repetitions in a repeating field

Notes

Clicking a button or tab control does not activate this trigger on the
button or tab. Pressing Tab to navigate to a button or tab and make it
the active object does activate this trigger.


FileMaker: close but no cigar.

Maybe I am missing the subtlety.

Reply With Quote
  #4  
Old   
Lynn Allen
 
Posts: n/a

Default Re: Can I set a variable based on the selected tab? - 12-17-2009 , 04:32 PM



On 2009-12-17 13:27:23 -0800, 105 <cortical (AT) internode (DOT) on.net> said:

Quote:
FileMaker: close but no cigar.

Maybe I am missing the subtlety.
With those functions and one other, GetLayoutObjectAttribute(probably
need Get(ActiveLayoutObjectName) here, IsFrontmostTab) please look this
up for precise name & syntax, you can test which tab has focus. When
you apply the above function to the tab object, it will return a 1 or 0
depending if the named object is the frontmost tab.

I haven't needed to use this much so I'm a little fuzzy on exact
syntax. But it's the only way to test whether a specific tab is
frontmost (has focus or is active).
--
Lynn Allen
--
www.semiotics.com
Member FBA
FM 10 Certified Developer

Reply With Quote
  #5  
Old   
jahn
 
Posts: n/a

Default Re: Can I set a variable based on the selected tab? - 12-17-2009 , 07:19 PM



Fabrice Nordmann has written some brilliant custom functions that are
available on Brian Dunning's site. Check out http://www.briandunning.com/cf/809
for his function isFrontMostTabPanel ( _objectName ). But functions
in themselves won't trigger a script when a tab is clicked, so you'd
still need something to set the filter field, which is why I was
suggesting buttons instead of tab panels or separate portals using
different match fields. It depends on the layout and what you're
trying to achieve.

Hey, Mr. 105: It's not all bad news. FM Inc. has delivered a pretty
sweet tool. Just because we want more doesn't mean they're not doing
a hell of job -- it just means they've got us warmed up for what comes
next.

-J.

Reply With Quote
  #6  
Old   
105
 
Posts: n/a

Default Re: Can I set a variable based on the selected tab? - 12-18-2009 , 12:08 AM



jahn wrote:
Quote:
Fabrice Nordmann has written some brilliant custom functions that are
available on Brian Dunning's site. Check out http://www.briandunning.com/cf/809
for his function isFrontMostTabPanel ( _objectName ). But functions
in themselves won't trigger a script when a tab is clicked, so you'd
still need something to set the filter field, which is why I was
suggesting buttons instead of tab panels or separate portals using
different match fields. It depends on the layout and what you're
trying to achieve.
Yes I have always used buttons, having not found a more 'native' way

Quote:
Hey, Mr. 105: It's not all bad news. FM Inc. has delivered a pretty
sweet tool. Just because we want more doesn't mean they're not doing
a hell of job -- it just means they've got us warmed up for what comes
next.

Hi Jahn,

Well I wouldn't say sweet, versatile certainly, and not bad news, but
very tedious in so many ways. Shiny not polished. Which does not mean I
don't use it every day... (and still have FMp 1.0 v1 on a Mac SE).

What probably comes next is more than likely another minor feature set
revision. Sadly.

Reply With Quote
  #7  
Old   
105
 
Posts: n/a

Default Re: Can I set a variable based on the selected tab? - 12-18-2009 , 12:09 AM



Lynn Allen wrote:
Quote:
On 2009-12-17 13:27:23 -0800, 105 <cortical (AT) internode (DOT) on.net> said:

FileMaker: close but no cigar.

Maybe I am missing the subtlety.

With those functions and one other, GetLayoutObjectAttribute(probably
need Get(ActiveLayoutObjectName) here, IsFrontmostTab) please look this
up for precise name & syntax, you can test which tab has focus. When you
apply the above function to the tab object, it will return a 1 or 0
depending if the named object is the frontmost tab.

I haven't needed to use this much so I'm a little fuzzy on exact syntax.
But it's the only way to test whether a specific tab is frontmost (has
focus or is active).

thanks Lynn, I'll delve again.

Reply With Quote
  #8  
Old   
GSP@DavClaServ
 
Posts: n/a

Default Resolved: Can I set a variable based on the selected tab? - 12-18-2009 , 05:19 AM



Thanks Lynn - but if I understand what you're saying this will test to see
if "objectname" has the focus (boolean), which is a step in the desired
direction. But what I was looking for was the name of the object to be
returned. Witht the boolean function you'd have to code in the name of the
objects.

I've conceded and gone with the different portals and buttons solution. It
seems there have been a lot sharper minds than mine that have looked at this
and had to take that path.

Thanks to all for your feedback.

"Lynn Allen" <lynn (AT) NOT-semiotics (DOT) com> wrote

Quote:
On 2009-12-17 13:27:23 -0800, 105 <cortical (AT) internode (DOT) on.net> said:

FileMaker: close but no cigar.

Maybe I am missing the subtlety.

With those functions and one other, GetLayoutObjectAttribute(probably need
Get(ActiveLayoutObjectName) here, IsFrontmostTab) please look this up for
precise name & syntax, you can test which tab has focus. When you apply
the above function to the tab object, it will return a 1 or 0 depending if
the named object is the frontmost tab.

I haven't needed to use this much so I'm a little fuzzy on exact syntax.
But it's the only way to test whether a specific tab is frontmost (has
focus or is active).
--
Lynn Allen
--
www.semiotics.com
Member FBA
FM 10 Certified Developer

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.