Web Page - List - controlling the display of list rows

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
Joerg Hamacher
Posts: 124
Joined: Thu Feb 11, 2016 12:01 am

Web Page - List - controlling the display of list rows

Post by Joerg Hamacher »

Hi,

when working with lists containing a lot of rows our customer wants to have the possibility to position the list by selecting e.g. a customer number.
After typing in a customer number the row of thís customer shall be displayed as first row in the display (without again reading or sorting the list).

So we make a SELECTLIST and when getting to the entry with the given customer number we set:
#List1.CurrentItem.Focus := True

But now - depending on the momentarily shown lsit rows - the row with the selected customer is displayed as first or last row or something in between.
What do we have to do to get this selected row always displayed as the first one?

Best regards,
Joerg
caseywhite
Posts: 192
Joined: Thu May 26, 2016 1:17 am

Re: Web Page - List - controlling the display of list rows

Post by caseywhite »

This should do what you want. Keep in mind that if the entry is near the bottom of the list, "Top" will not put it at the very top of the list if there aren't enough entries below it.

Code: Select all

Selectlist Named(#List1)
If Cond(#YOURFIELD = YOURVALUE)
#List1.VerticalScrollTo Item(#LiST1.CurrentItem) Scrollposition(Top)
Leave
Endif
Endselect
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: Web Page - List - controlling the display of list rows

Post by atostaine »

That's pretty cool Casey.

Art
Art Tostaine
Joerg Hamacher
Posts: 124
Joined: Thu Feb 11, 2016 12:01 am

Re: Web Page - List - controlling the display of list rows

Post by Joerg Hamacher »

That's great - thank you very much, Casey.
Have a nice weekend,
Joerg
Post Reply