Show the Browse List last Page last Record

I am a hobby programmer and please take note of this. I only work exclusively with the application generator and insert handwritten code snippets in the Embeds. I now have a problem: I have written a chat program for a mobile screen application. I have added an Event Timer so that the conversation participant always receives the latest message updates that I send, ensuring they always have the most recent messages.

However, I have sorted the list from A to Z so that the last entry is always at the bottom, as is typical with normal messaging apps. But I have no idea what I need to do to ensure that the last record is always displayed in the browse list and that it always shows the last page instead of the first page.

Take a look at EVENT:ScrollBottom

1 Like

Abc or legacy?

On the timer event embed, you could

 select(?listbox)
Presskey(endbutton)

You’ll have to look in the equates.clw file for the exact wording of the end button, but for every timer event, that will select the listbox if its not already got focus and then replicate a user pressing the end key which would take you to the bottom of the list.

Theres other ways it could be done, but without knowing if you are using abc or legacy templates, I cant really comment at this stage.

1 Like

It’s ABC Legacy. Thank you so much for helping

Sorry ABC Clarion I take. Thank you for the support

This thread has a similar problem but with a parent file, but the principles are no different.

This link has a toolbar method, which does similar. You would need to track down the toolbar event thats being posted, and I think the one Lee posted is what would help.

In essence instead of mimicking the user with a presskey, this is using an event which does similar, ie it posts an event:scrollbottom to the windows accept loop. I dont have my computer on so Im going from a rapidly fading memory.

The Solution is:
POST(EVENT:ScrollBottom, ?List)
DISPLAY(?List)
thats function very good

Thank you so much on all Now is the Chat App for Smartphone funtion
Best regards Walter

If you are using ABC, you might notice better performance with:

  YourBrowse.TakeScroll(Event:ScrollBottom)

That leaves out the delay of the event posting/reading.

2 Likes

I didnt even think of that. Maybe its time to call myself a hobbyist as well and find a different job because my brain is being frazzled.

I think the placement of that code (which embed) would matter much much more. I.e. it assumes the Browse object has been completely configured and loaded.

Using POST EVENT:ScrollBottom is asynchronous. It can be done anytime after the OPEN(Window). It will not be processed until after the Accept Loop starts, and after Event:OpenWindow (or Gain Focus). The Browse is configured and loaded by then.

1 Like

OK. I was talking about avoiding the unnecessary delay. It would definitely need to be done after the objects are initialized.

1 Like