Page 1 of 1

Position to last #PRIM_MD.List row

Posted: Thu Nov 22, 2018 12:32 pm
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

Re: Position to last #PRIM_MD.List row

Posted: Sun Nov 25, 2018 5:49 am
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.

Re: Position to last #PRIM_MD.List row

Posted: Mon Nov 26, 2018 11:39 am
by jonno
Thnks Art but I have already tried .focus and it doesnt work and .ensureVisible is not available for Prim_MD

Re: Position to last #PRIM_MD.List row

Posted: Mon Nov 26, 2018 12:13 pm
by atostaine
Oh sorry about that.

Re: Position to last #PRIM_MD.List row

Posted: Mon Nov 26, 2018 1:42 pm
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