easiest way is to use the "Go to Portal Row" script function after you've set the selected portal row to a variable. Then in the Go to Portal Row script step you can specify which row and you would provide your variable. Filemaker will then highlight the row.
Note, this only works consistently if you have only one portal on your layout. If you have more than one, you need to establish focus on the correct portal or use another mechanism which would allow you to specify the selection using a calulated graphic...
...which, if you really need a little triangle to appear is the way you would have to do it.
Thanks for the quick reply.
The proposal seems an elegant way to achieve the goal.Unfortunately I do have more than one portal on the layout.
So, it seems that I would have to investigate calculated graphics. Would I insert such a graphic into the portal row by script or would I include a field or button in the portal layout and fill it by a script? Of course it would have to disappear or go blank if the row selection changes. Any idea?
1. create a global field of type container and use that to store the graphic you want
2. create a calculated field of type container that has a calculation like this:
what this does is evaluates if the item ID in the row matches the global gItemID and if it does, well by golly show the graphic you stored in the global container field and if it doesn't dont show anything.
3. Create a script that sets the selected row item ID to a global (gItemID above) and assign that to a button of some kind in the row - or make an invisible button so the user can click anywhere on the row.
4. Voila, little arrows can appear in any portal on your layout without worrying about focus.
I use this technique when I need to build a drill-down, multi-portal interface.
That sounds like exactly what I was looking for.
I owe you a pint.
I'll try it out. May take a litle while though.
Thanks for your kind help.
i like pints! preferably Guiness or Belhaven.
Depending on how your IDs are set up, you could potentially have identical IDs in different portals on this layou, all of which would have the triangle - so portal focus could still be an issue. You can get around this by using a different global field for each portal on the layout, and making sure your button action sets the appropriate global value.
yes, important point mike! I do set different target globals when there are multiple portals, otherwise you end up with interface madness.
It would be easiest to simply not put the graphics field on any portal where you don't need it.
The IDs are just serial numbers, automatically calculated at record creation. So it is an issue. Thanks for the hint! That makes two pints.
As I said, it'll take me a little while. I'll let you know how it goes.
Well, I don't understand the implications yet of this approach. But for the exercise I'm doing it has its value to find a way of doing it. But you may turn out to be right in the end.
Keep in mind that Adam's first post indicated that you can use his technique with multiple portals, if you first place focus on the correct portal before performing the go to portal row.
Just give your different portals object-names via the Inspecor panel, and perform a Go to Layout Object (by name) immediately before doing the go to the portal row.
I'll keep that in mind and I'll try to consider all advice given here. Thanks again to all of you kind people.
okay, here's the first feedback:
I made the first field in the portal a button and assigned a script that has the following script step:
Go To Portal Row [Select; Get (ActivePortalRowNumber)
What happens is, when I click the button in a row a dialogue pops up asking whether I want to go to row number x of xx rows. If I confirm, the row is highlighted.
I have two questions:
- Can I avoid this dialog (the number is known)?
- Can I define the highlight colour for the row?
Johannes, if I may chime in: IMHO using portal rows is unnecessary complicated.
Have a look at the attached sample file on how to use conditional formatting to highlight the selected portal record and/or put a graphics marker in it.
You can also see the same (almost) portal on the layout without those visual clues, so there is no UI mess. Lastly, selecting a child record via portal row doesn't do you much good if you need to set the focus on it to do stuff.