colour select a portal row? 
Author Message
 colour select a portal row?
Dear folks,
Does anyone know if you can highlight a portal row?
SAy you select a row to perform an operation via script - can that row be
highlighted?

Also, any hints as to how to highlight a field that has a certain value
entered into it.
Say a field holds data (anumber) and if (anumber>100) then set the fill
colour to "red".

My thanks to those scratching their heads over these questions.
Greg



Fri, 11 Jul 2003 17:40:11 GMT
 colour select a portal row?

Hi Greg -

If you click in a portal row (but not inside one of the fields) the row will
be highlighted in a contrasting color.  Is that what you meant?  Also, you
can perform a script referencing a particular row using the Go to Portal Row
step.  You can even go to a particular row number using this step.  You can
use the function Status(CurrentPortalRow) to return a value that you could
use for some operations; depending on what you are actually trying to do,
this might be helpful.

Setting the color of a field according to a test is not hard.  This has been
covered often in the group and I'm sure you can find it.  It involves
creating a calc field of type container returning a colored object from a
container field contingent upon your test.  Then you make the "real" field
transparent and put the color field behind it.  If you have trouble with it,
please let the group know and I or others will go through the steps, but it's
kind of a cool trick and you might enjoy working it out.

Best of Luck -
James

Quote:

> Dear folks,
> Does anyone know if you can highlight a portal row?
> SAy you select a row to perform an operation via script - can that row be
> highlighted?

> Also, any hints as to how to highlight a field that has a certain value
> entered into it.
> Say a field holds data (anumber) and if (anumber>100) then set the fill
> colour to "red".

> My thanks to those scratching their heads over these questions.
> Greg

--
Don't forget to remove the obvious spam block when replying.
I advocate making an address book entry and using it!  Thanks!


Fri, 11 Jul 2003 18:26:27 GMT
 colour select a portal row?

Quote:

> Dear folks,

> Also, any hints as to how to highlight a field that has a certain value
> entered into it.
> Say a field holds data (anumber) and if (anumber>100) then set the fill
> colour to "red".

You can't highlight the field itself, but you can do a work-around that
looks like it does.

Create a global contianer field that holds a "higlight" colour
rectangle. In layout mode, draw a red filled rectangle of the right
size and cut/copy it. Go into Browse mode and paste this into your
highlight field. After you've pasted the rectangle in to you global
highlight field you can delete it from your layouts.

Then use calculation fields that returns a container result and put
them behind the normal (transparently filled) fields to highlight the
right spots. You may have to play with the Graphic formatting of the
field on the layout using croping/scaling until it looks the way you
want.

Example
-------
Define your fields as:

    gRed Fill         = Global Container with red filled rectangle

    anumber Highlight = If (anumber > 100, gRed Fill, "")  
    [Container result]

Then on the layout, put the anumberHighlight field behind your anumber
field (making sure the anumber field has a transparent fill). Now
whenever anumber is more than 100, the Highlight field will turn red,
otherwise it is empty.

Or, if you want an alternating colour, set up another global container
field which is say a green filled rectangle and change the calculated
field to:

    anumber Highlight = If (anumber > 100, gRed Fill, gGreen Fill)
    [Container result]

Quote:
> Does anyone know if you can highlight a portal row?
> SAy you select a row to perform an operation via script - can that row be
> highlighted?

If you mean the user highlights a portal row, then they can click in
any blank area (ie. no field) on the portal row for it to highlight.
This is a normal part of FileMaker Pro (at least it is in the Mac
version).

You can also put a button in the portal row that runs the script. Just
define one button and put it in the top portal row on your layout, then
this is replicated to other portal rows whenever they contain data in
browse mode. You can then use the Status(CurrentPortalRow) function if
you need to find out which portal row that is.

From within a script, the Got To Portal Row command has an option to
"Select the contents", which will highlight it in the same way as the
user clicking on a blank area.

If you mean you want to highlight the portal row using a different
colour, you can do the same thing as above for the portal using a
highlight field for each portal row and set the calculation as:
     Portal Highlight 1 = If (Status(CurrentPortalRow)=1, gRed Fill, "")
     Portal Highlight 2 = If (Status(CurrentPortalRow)=2, gRed Fill, "")
     etc.

Or if you are using a script you can use a repeating field and set the
appropriate repetition of the field for the current portal row, making
sure to "clear" out the other repetitions.

Quote:
> My thanks to those scratching their heads over these questions.
> Greg

I hope that all makes some sort of sense to you.   :o)

Helpful Harry                  
"Just trying to help whenever I can."      :o)



Sat, 12 Jul 2003 04:56:31 GMT
 colour select a portal row?
Dear Harry & James & group,
thanks for the hints and very clear info - its obvious and I have it working
already.

Yep - I needed to specifically highlight a portal row - I had a button that
made a selection of a row but needed to leave that row highlighted to alert
the user.  Not the same as clicking outside the field on a row.  I had it in
mind that (currentportalrow) was the way to go but sometimes the brain slows
to a feet dragging pace when confronted with some of this.

Harry, I didnt quite get the repeating field part tho - is this just to
store the portal row? or is this a nifty trick to hold a colour and slide
over the portal rows??

Thanks to both of you - hope I can return the favour one day.

Greg


Quote:


> > Dear folks,

> > Also, any hints as to how to highlight a field that has a certain value
> > entered into it.
> > Say a field holds data (anumber) and if (anumber>100) then set the fill
> > colour to "red".

> You can't highlight the field itself, but you can do a work-around that
> looks like it does.

> Create a global contianer field that holds a "higlight" colour
> rectangle. In layout mode, draw a red filled rectangle of the right
> size and cut/copy it. Go into Browse mode and paste this into your
> highlight field. After you've pasted the rectangle in to you global
> highlight field you can delete it from your layouts.

> Then use calculation fields that returns a container result and put
> them behind the normal (transparently filled) fields to highlight the
> right spots. You may have to play with the Graphic formatting of the
> field on the layout using croping/scaling until it looks the way you
> want.

> Example
> -------
> Define your fields as:

>     gRed Fill         = Global Container with red filled rectangle

>     anumber Highlight = If (anumber > 100, gRed Fill, "")
>     [Container result]

> Then on the layout, put the anumberHighlight field behind your anumber
> field (making sure the anumber field has a transparent fill). Now
> whenever anumber is more than 100, the Highlight field will turn red,
> otherwise it is empty.

> Or, if you want an alternating colour, set up another global container
> field which is say a green filled rectangle and change the calculated
> field to:

>     anumber Highlight = If (anumber > 100, gRed Fill, gGreen Fill)
>     [Container result]

> > Does anyone know if you can highlight a portal row?
> > SAy you select a row to perform an operation via script - can that row
be
> > highlighted?

> If you mean the user highlights a portal row, then they can click in
> any blank area (ie. no field) on the portal row for it to highlight.
> This is a normal part of FileMaker Pro (at least it is in the Mac
> version).

> You can also put a button in the portal row that runs the script. Just
> define one button and put it in the top portal row on your layout, then
> this is replicated to other portal rows whenever they contain data in
> browse mode. You can then use the Status(CurrentPortalRow) function if
> you need to find out which portal row that is.

> From within a script, the Got To Portal Row command has an option to
> "Select the contents", which will highlight it in the same way as the
> user clicking on a blank area.

> If you mean you want to highlight the portal row using a different
> colour, you can do the same thing as above for the portal using a
> highlight field for each portal row and set the calculation as:
>      Portal Highlight 1 = If (Status(CurrentPortalRow)=1, gRed Fill, "")
>      Portal Highlight 2 = If (Status(CurrentPortalRow)=2, gRed Fill, "")
>      etc.

> Or if you are using a script you can use a repeating field and set the
> appropriate repetition of the field for the current portal row, making
> sure to "clear" out the other repetitions.

> > My thanks to those scratching their heads over these questions.
> > Greg

> I hope that all makes some sort of sense to you.   :o)

> Helpful Harry
> "Just trying to help whenever I can."      :o)



Sat, 12 Jul 2003 07:59:19 GMT
 colour select a portal row?

Quote:

> Dear Harry & James & group,
> thanks for the hints and very clear info - its obvious and I have it working
> already.

> Yep - I needed to specifically highlight a portal row - I had a button that
> made a selection of a row but needed to leave that row highlighted to alert
> the user.  Not the same as clicking outside the field on a row.  I had it in
> mind that (currentportalrow) was the way to go but sometimes the brain slows
> to a feet dragging pace when confronted with some of this.

> Harry, I didnt quite get the repeating field part tho - is this just to
> store the portal row? or is this a nifty trick to hold a colour and slide
> over the portal rows??

> Thanks to both of you - hope I can return the favour one day.

> Greg

Sorry, re-reading my reply I thought the repeating field might not have
been explained properly.   :o\

It's probably not worth using anyway. It does tidy up your field
definitions, it makes a real mess of your script.

Instead of creating a separate calculation field for each portal row
(with a container result), you can use one normal container field with
the repeating option turned on to however many portal rows you've got.

You can't use a repeating calculation field since there's no way to set
an individual repetition's value in a calculation. You can only do it
via your script, where you can set and unset the repetitions as needed.

BUT, you can't use SetField to set a field repetition defined by
another field or Status function (at least not in FileMaker Pro 4.x).
ie. there's no command like
    SetField(Portal Highlight, Rept#(CurrentPortalRow), gRed Fill).

Because of this you end up having to create a pile of If...Else..Endif
statements in your script, one for each repetition to "turn on" or
"turn off" the colour as appropriate.

eg. Using Portal Highlight as the repeated field with only three
    repetitions you would end up with ...

     [Set or clear portal row 1 highlight]
     [The first value is the normal field value]

          If (Status(CurrentPortalRow = 1))
              SetField(Portal Highlight, gRed Fill)          
          else
              SetField(Portal Highlight, "")
          EndIf

     [Set or clear portal row 2 highlight]
     [The second value is repetition -1]

          If (Status(CurrentPortalRow = 2))
              SetField(Portal Highlight;-1, gRed Fill)
          else
              SetField(Portal Highlight;-1, "")
          EndIf

     [Set or clear portal row 3 highlight]
     [The third value is repetition -2]

          If (Status(CurrentPortalRow = 3))
              SetField(Portal Highlight;-2, gRed Fill)
          else
              SetField(Portal Highlight;-2, "")
          EndIf

As you can see, the more portal rows you have, the longer and messier
it gets. You are basically putting all the field calculations you would
use for the separate calculation field method into your script instead.

I probably shouldn't have even bothered to mention it. It's a pretty
yucky way to do it.   :o\

Helpful Harry                  
"Just trying to help whenever I can."      :o)



Sat, 12 Jul 2003 10:29:03 GMT
 colour select a portal row?
Dear Harry,
ta for the clarification, thats OK -  Ive done worse before - chuckle.
Can see what you mean - interesting tho -thanks
Greg


Quote:


> > Dear Harry & James & group,
> > thanks for the hints and very clear info - its obvious and I have it
working
> > already.

> > Yep - I needed to specifically highlight a portal row - I had a button
that
> > made a selection of a row but needed to leave that row highlighted to
alert
> > the user.  Not the same as clicking outside the field on a row.  I had
it in
> > mind that (currentportalrow) was the way to go but sometimes the brain
slows
> > to a feet dragging pace when confronted with some of this.

> > Harry, I didnt quite get the repeating field part tho - is this just to
> > store the portal row? or is this a nifty trick to hold a colour and
slide
> > over the portal rows??

> > Thanks to both of you - hope I can return the favour one day.

> > Greg

> Sorry, re-reading my reply I thought the repeating field might not have
> been explained properly.   :o\

> It's probably not worth using anyway. It does tidy up your field
> definitions, it makes a real mess of your script.

> Instead of creating a separate calculation field for each portal row
> (with a container result), you can use one normal container field with
> the repeating option turned on to however many portal rows you've got.

> You can't use a repeating calculation field since there's no way to set
> an individual repetition's value in a calculation. You can only do it
> via your script, where you can set and unset the repetitions as needed.

> BUT, you can't use SetField to set a field repetition defined by
> another field or Status function (at least not in FileMaker Pro 4.x).
> ie. there's no command like
>     SetField(Portal Highlight, Rept#(CurrentPortalRow), gRed Fill).

> Because of this you end up having to create a pile of If...Else..Endif
> statements in your script, one for each repetition to "turn on" or
> "turn off" the colour as appropriate.

> eg. Using Portal Highlight as the repeated field with only three
>     repetitions you would end up with ...

>      [Set or clear portal row 1 highlight]
>      [The first value is the normal field value]

>           If (Status(CurrentPortalRow = 1))
>               SetField(Portal Highlight, gRed Fill)
>           else
>               SetField(Portal Highlight, "")
>           EndIf

>      [Set or clear portal row 2 highlight]
>      [The second value is repetition -1]

>           If (Status(CurrentPortalRow = 2))
>               SetField(Portal Highlight;-1, gRed Fill)
>           else
>               SetField(Portal Highlight;-1, "")
>           EndIf

>      [Set or clear portal row 3 highlight]
>      [The third value is repetition -2]

>           If (Status(CurrentPortalRow = 3))
>               SetField(Portal Highlight;-2, gRed Fill)
>           else
>               SetField(Portal Highlight;-2, "")
>           EndIf

> As you can see, the more portal rows you have, the longer and messier
> it gets. You are basically putting all the field calculations you would
> use for the separate calculation field method into your script instead.

> I probably shouldn't have even bothered to mention it. It's a pretty
> yucky way to do it.   :o\

> Helpful Harry
> "Just trying to help whenever I can."      :o)



Sat, 12 Jul 2003 20:17:29 GMT
 
 [ 6 post ] 

 Relevant Pages 

1. Goto related from portal --how do I get the selected portal row

2. keeping row selected in multiple portals

3. portal row select

4. question regarding select (multiple rows select into one result row)

5. Changing colour between rows

6. Change a particular row's colour in DBGrid

7. Row Colour

8. colour marked of rows

9. Listboxes: colour/bold on certain rows?

10. Selecting a row by it's row number

11. Q: sql select where criteria for each row is not wholly contained in the row

12. select case return rows in one row (how to group by three column)


 
Powered by phpBB® Forum Software