In doing some additional work I think I found a solution to this
problem. The solution is to have the script executed by the button
open a new window and do it's work there and then close the window. The
smoothest result seem to come if I execute the Freeze Window command
just before opening the New Window.
By doing it this way on my system, the new window never actually
appears, but the work is completed and the active line in the portal
remains in the same relative location.
Again thanks to all for your suggestions.
Bruce Herbach
Tom, Jason and Lee,
Thanks very much for the suggestions. For the moment I think I can
live with it the way it is. I have the portal set with alternate
background fill and the active line is highlighted in a separate color
so the user knows which line is selected.
The Portal is set up with 24 lines and a scroll bar to show all
records. While in the first 24 lines or when sequentially selecting
lines this works well. The active line stays in the same relative
position. It is only when you use the scroll bar to go down a couple
of screens and select a line in the middle of the display and then
press the button that the active line jumps to the bottom of the display.
I went through all of the get commands and couldn't find one that gave
the display line or a matching command to move the active record to
the specific display line in the portal. Possibly this could be an
addition for the next version of FM.
Best regards
Bruce Herbach
Tom Elliott wrote:
Bruce
There is a way to do this using GetLayoutObjectattribute() to
calculate the original pixel position of the portal row and then (on
return) doing some calculations to reinstate the portal as it was -
it's not exactly 'easy' but if Jason's 'new workspace' method isn't
going to work I can post the details
cheers
Tom
On 5 Jan 2008, at 19:34, Bruce Herbach wrote:
I have a working portal with a few hundred lines of data in an FM9
database. The Portal has 24 lines and on each line there is a
button that runs a script to create an associated record.
When the script returns it goes back to the same record in the
portal but the record is now the bottom line in the open portal. I
have been able to use Go to Portal Row to move this up one or two
rows but I have not been able to come up with a way to record or
return to the original position.
What I would like to do is return to the original position with in
viewing area of the portal. So if the selected record is the middle
line of the the portal when the script comes back it is still the
middle line.
The current method works and is adequate for sequential data entry
top to bottom, but it is a bit disconcerting to the user when the
moving up an down with in the portal to have the active line jump to
the bottom of the portal after the button has been pressed.
Does anyone have an easy way to do this?
Thanks
Bruce Herbach