Position to last #PRIM_MD.List row

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
jonno
Posts: 8
Joined: Thu Nov 22, 2018 12:18 pm

Position to last #PRIM_MD.List row

Post by jonno »

Additional note: this code seems to work on a desktop so maybe an iPad specific issue

I have an iPad application running Vl4Web
I am dynamically building list entries, one at a time in a web page. I have a small dialog that shows the list.
When the page is full the scroll bar shows but the last entry doesn't show and I have to scroll.
I have tried .Focus but that doesn't seem to work.
Anyone have any ideas?

* server routine call
#continue.ExecuteAsync fullresponse(#wrk5000) text(#wrk255) context(#context) response(#std_qsel)

* build list
evtroutine handling(#continue.Completed)

set com(#ListPrimaryText) icon('') iconalignment('center') iconheight(30) caption(#std_qsel) captionalignment('CenterRight') themedrawstyle(ForegroundTheme)
add_entry to_list(#List)
#List.CurrentItem.Focus := true
endroutine
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: Position to last #PRIM_MD.List row

Post by atostaine »

Try adding this

#List.CurrentItem.Focus #List.CurrentItem.ensureVisible ::= true

You don't need to do it each time an entry is added. Do it outside of your loop when all the entries are added.
Art Tostaine
jonno
Posts: 8
Joined: Thu Nov 22, 2018 12:18 pm

Re: Position to last #PRIM_MD.List row

Post by jonno »

Thnks Art but I have already tried .focus and it doesnt work and .ensureVisible is not available for Prim_MD
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: Position to last #PRIM_MD.List row

Post by atostaine »

Oh sorry about that.
Art Tostaine
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: Position to last #PRIM_MD.List row

Post by atostaine »

Have you tried setting focus on the last entry only? Maybe the Prim_md list is setting focus on all of them.

Art
Art Tostaine
Post Reply