Jump to content

Returning to same Scroll Row on Layout


This topic is 2993 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello,

I am using Windows OS for my solution.  I have a layout in list view showing events. An admin user is to add groups of people as attendees of these events by pressing a button to run a script.  The script Freezes the window, changes layout, adds the attendees in the relevant table and returns the user to the original layout.

This all works well, except for when the script returns to the original layout and unfreezes the window, the scroll position of the active row (the record that the user is editing) jumps to the bottom of the screen.  I would like the scroll position to remain static or be returned to where it was before the script changes the layout - so a change is imperceptible to the user.

The Window Scroll options seem limited to top, bottom, pg up, pg down.  I have also tried having the script open a new window before changing the layout, but you then see the script working - if only briefly - as the new window comes to the front.

Has anybody got any suggestions on how I can return the scroll position to exactly where it was before the script executes?

Thanks in advance,

Ben

Edited by benmort81
clarity
Link to comment
Share on other sites

Easiest would be to have the script not change layouts but open a new window, then change layout, do it's stuff, close window.  Another reason the position could be changing is if the script is changing the record in a way that it's changing the sort order.

Link to comment
Share on other sites

I agree with Steve.

I like to include a few sub-scripts to my solutions that assist with this. In essence, they open/close process windows to do stuff in the background:

Process_Window_Open
------------------------------------
Allow User Abort
[ Off ]
Set Error Capture [ On ]
Set Variable [ $$p_window; Value: If(IsEmpty($p_window), 1, $p_window) ]
If [ Get(ActiveModifierKeys) = 1 ]
   New Window [ Style: Document; Name: "p" & $$p_window; Height: 300; Width: 300; Close: Yes; Minimize: Yes; Maximize: Yes; Zoom Control Area: Yes; Resize: Yes ]
Else
   New Window
[ Style: Document; Name: "p" & $$p_window; Height: 10; Width: 10; Top: Get(WindowDesktopHeight) + 50; Left: Get (WindowDesktopWidth) + 50; Close: Yes; Minimize: Yes; Maximize: Yes; Zoom Control Area: Yes; Resize: Yes ]
End If
Set Variable
[ $$p_window; Value:$$p_window + 1 ] 

-- This script allows for a window to pop open OFF SCREEN (or you can debug/view the window holding the SHIFT KEY) that is indexed (pX) to do background processing.

Process_Window_Close 
--------------------------------------

Allow User Abort [ Off ]
Set Error Capture [ On ]
If [ IsEmpty (Get(ScriptParameter) ) ]
   
Close Window [ Current Window ]
Else
   Close Window
[ Name: Get(ScriptParameter) ]
End If 

-- This script allows for you to close the current window or a targeted window via the Get(ScriptParameter) option.

Now you can use these sub-scripts when needed like the following example:

Allow User Abort [ Off ]
Set Error Capture [ On ]
Stuff
Stuff
Stuff
// Open first processing window = p1
Perform Script ["
Process_Window_Open"]
Stuff
Stuff
// Open second processing window = p2
Perform Script ["
Process_Window_Open"]
Stuff
Stuff
Stuff
Stuff
// Closes second processing window = p2

Perform Script ["Process_Window_Close, parameter ="p2""]
Stuff
Stuff
// Closes first processing window = p1
Perform Script ["
Process_Window_Close"]

Hope this helps!!!

  • Like 1
Link to comment
Share on other sites

This can also be done without opening any new windows; by using global selector fields and where necessary, relationship designed to allow record creation by using these global fields.

Link to comment
Share on other sites

On 15/01/2016 at 8:01 PM, dwdata said:

I like to include a few sub-scripts to my solutions that assist with this. In essence, they open/close process windows to do stuff in the background:

Thanks for sharing these sub-scripts.  Using Windows OS, I still have the problem that the user's current screen is resized, albeit briefly whilst the new process window comes to the fore (off-screen).  I have worked around this by reducing the user's window by 4 points on layout enter.  It's not perfect, but it does not interrupt the work flow or lead to ugly jumping around, so that will have to do for now.

Thanks again.

Ben

 

Link to comment
Share on other sites

This topic is 2993 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.