Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Filemaker > Re: Show hide f...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 10 of 10 Topic 7966 of 8265
Post > Topic >>

Re: Show hide fields

by Helpful Harry <helpful_harry@[EMAIL PROTECTED] > Apr 19, 2008 at 06:18 PM

In article
<d1d76979-3833-45a6-89b5-9056527a04e0@[EMAIL PROTECTED]
>,
tdavie <timothydavie@[EMAIL PROTECTED]
> wrote:

> On Apr 12, 11:55 am, Grip <g...@[EMAIL PROTECTED]
> wrote:
> >
> > I'm assuming you have a border around the field with a line color
> > different than the background color or that the field has a fill color
> > that is different than the background color.  If it's the latter, you
> > can set the Conditional Formatting for the field to a formula
> > IsEmpty(field) and set the fill color the same as the background it's
> > a border issue, you need to turn off the border and recreate it using
> > a text box.  The text box need only contain a single space. Set the
> > fill color for the box to what you want the border color to be and
> > make it 2 pixels bigger in each dimension than the field.  Bring the
> > field in front of the text box and center it.  Now you have a new
> > border made from a text box and can set the conditional formatting to
> > the background color as above.
> >
> > This process is easier if you zoom in 300 or 400 %.
> 
> Is there not a way to actually show or hide a field? I'm working in FM
> Pro 7 and would like to do the same thing. The only way I've thought
> of to do it is make a whole new layout, then just have my button
> switch me over to that layout. There should be a better way, no?

You can do a similar trick using a Calculation field with a Container
result behind the normal field that displays an image to fake the field
border, but neither way really hides the field - users can still click
in it or tab into it (if the field is in the Tab Order).

A better trick is to put the field(s) inside a ****tal, that way you can
"show" or "hide" the field(s) by making the ****tal's Relation****p valid
or invalid. This "****tal trick" is explained further down.

The problem with all of these methods is that you can't overlap fields
(while still able to click in them) nor overlap ****tals, so whenever
the field is "hidden" you are left with a blank space on screen.

A better method is usually to use separate Layouts as you already do.
To ease the complexity from the user, you may not need to bother with
an actual button. You can use 'invisible' buttons (no fill or line
colour) over a field that run scripts to set the appropriate data and
change Layouts.
eg.
      Have a Gender radio button field and put 'invisible' 
      buttons over each option that run an appropriate script.
      One button sets the field to "Male" and changes to the 
      Male Layout, while the other button sets the field to
      "Female" and changes to the Female Layout

Unfortunately this only works for Radio button or Check box fields (or
fields you 'toggle' by just clicking on them), unless you use a plug-in
to run a script when data in a field is changed.

I'm not sure how the Tabbed Layouts in newer versions of FileMaker
work, so they might or might not be another method of displaying
different fields.


"****tal Trick"
--------------
First you need a field that is a unique ID for each record so that only
data from the current record is shown in the ****tal.
eg.
      ThisRecord        Number
                        Auto-enter Serial Number
                        Start R1    Increment by 1

Then you need two fields to act as the Key / Link fields for the
Relation****p - both fields will use the unique ID above combined with
the text of "Show" or "Hide". 

One field will ALWAYS be set to specific data to act as the Child-side
link.
eg.
      ShowHideConstant  Text  
                        Auto-enter Calculation: ThisRecord & "-Show"

The second field can be either a normal field (if using a button to
change visibility of the field) or a Calculation (if using another
field's data to alter visibility). Either way this field will be used
as the Parent-side of the Relation****p link. 
eg.
      ShowHideToggle    Calculation, Unstored, Text Result
                        = ThisRecord & If (Gender = "Male"; 
                                           "-Show"; 
                                           "-Hide")

Now you can define a Relation****p within the same Table (a "self-join"
Relation****p).
eg.
      rel_Show****tal    Match records in MyTable with records
                        in MyTable
                        when ShowHideToggle = ShowHideConstant

This Relation****p can be used by a one-row ****tal on your Layout and
the field you want to be able to hide put inside the ****tal (making
sure it too uses the Relation****p).

When the Gender field is set to "Male", both ShowHideConstant and
ShowHideToggle are "R1-Show", so the Relation****p is valid and the
****tal displays the 'related' fields (which are in reality fields from
the same record).

When the Gender field is set to "Female", ShowHideConstant is "R1-Show"
while ShowHideToggle is "R1-Hide", so the Relation****p is invalid and
the ****tal is empty ... and the field is 'invisible' and cannot be
clicked or tabbed into.





Helpful Harry                   
Hopefully helping harassed humans happily handle handiwork hard****ps  ;o)
 




 10 Posts in Topic:
Show hide fields
elisacarli <elisacarli  2008-04-12 02:47:27 
Re: Show hide fields
clk@[EMAIL PROTECTED] (C  2008-04-12 12:11:14 
Re: Show hide fields
Grip <grip@[EMAIL PROT  2008-04-12 06:22:58 
Re: Show hide fields
elisacarli <elisacarli  2008-04-12 06:50:21 
Re: Show hide fields
Grip <grip@[EMAIL PROT  2008-04-12 07:15:16 
Re: Show hide fields
elisacarli <elisacarli  2008-04-12 07:37:29 
Re: Show hide fields
Grip <grip@[EMAIL PROT  2008-04-12 11:55:32 
Re: Show hide fields
tdavie <timothydavie@[  2008-04-18 15:51:44 
Re: Show hide fields
MAP <marcapaiement@[EM  2008-04-18 19:01:04 
Re: Show hide fields
Helpful Harry <helpful  2008-04-19 18:18:04 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Sep 8 3:06:10 CDT 2008.