List Positioning

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
soa
Posts: 306
Joined: Mon Dec 07, 2015 3:15 pm

List Positioning

Post by soa » Fri Jul 06, 2018 2:31 pm

I have a view which contains a PRIM_TREE<xx>. Each time I show the page I clear and reload the tree. The tree contents is longer than the display area so I can scroll down to see more content. What I find is that if I scroll down the page then move to another view when I display the tree page again it shows the bottom half of the page again as if I had scrolled it even though I've cleared and reloaded it. It seems to remember its previous displayed position. Is there a way to ensure that item 1 in the Tree is always shown first?

Cheers
Jim

pkoopmanpk
Posts: 15
Joined: Wed Apr 26, 2017 7:12 pm

Re: List Positioning

Post by pkoopmanpk » Mon Jul 09, 2018 6:05 pm

Have you looked at the EnsureVisible property?

https://docs.lansa.com/14/en/lansa016/prim_tvit.htm

Turning it on for the first item in your treelist should do the trick I think.

soa
Posts: 306
Joined: Mon Dec 07, 2015 3:15 pm

Re: List Positioning

Post by soa » Tue Jul 10, 2018 8:28 am

I'll give that a go. Thanks!

BrendanB
Posts: 29
Joined: Tue Nov 24, 2015 10:29 am

Re: List Positioning

Post by BrendanB » Tue Jul 10, 2018 8:32 am

soa,

I use the following method:

Mthroutine Name(ScrollToTop)

#Tree.VerticalScrollTo( #Tree.Items<1>.Design Top)

Endroutine

The trick is that the 'control' is actually the design of the item.

Brendan.

Post Reply