Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: TListBox doesn't change ItemIndex when clicked in mobile?


This question is not answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Nov 1, 2017 8:42 AM Last Post By: Michael Leahy
Michael Leahy

Posts: 2
Registered: 11/10/17
TListBox doesn't change ItemIndex when clicked in mobile?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 20, 2017 12:47 PM
Delphi Tokyo 10.2

I drop a TListBox on a form in a new project. I add a few strings. I leave the ItemIndex set to -1.

I add an OnClick event which references the ItemIndex to get the highlighted string.

On Windows it gets the correct string.

On mobile (iOS and Android) the ItemIndex is still set to -1 during the OnClick event. After the event it is set properly.

Shouldn't the ItemIndex be correctly updated by the time the OnClick code runs? Like it is in Windows?
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: TListBox doesn't change ItemIndex when clicked in mobile?
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 20, 2017 12:59 PM   in response to: Michael Leahy in response to: Michael Leahy
Michael Leahy wrote:

Delphi Tokyo 10.2

I drop a TListBox on a form in a new project. I add a few strings. I leave the ItemIndex set to -1.

I add an OnClick event which references the ItemIndex to get the highlighted string.

On Windows it gets the correct string.

On mobile (iOS and Android) the ItemIndex is still set to -1 during the OnClick event. After the event it is set
properly.

Shouldn't the ItemIndex be correctly updated by the time the OnClick code runs? Like it is in Windows?

Looks like a bug (or at least, is inconsistent between platforms). Using OnItemClick works.

Can you report the problem, here?

https://quality.embarcadero.com/

--
Dave Nottage [MVP, TeamB]
Find hints, tips and tricks at Delphi Worlds blog: http://www.delphiworlds.com
Graham Murt

Posts: 70
Registered: 5/15/07
Re: TListBox doesn't change ItemIndex when clicked in mobile?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 24, 2017 7:34 AM   in response to: Dave Nottage in response to: Dave Nottage
Dave Nottage wrote:
Michael Leahy wrote:

Delphi Tokyo 10.2

I drop a TListBox on a form in a new project. I add a few strings. I leave the ItemIndex set to -1.

I add an OnClick event which references the ItemIndex to get the highlighted string.

On Windows it gets the correct string.

On mobile (iOS and Android) the ItemIndex is still set to -1 during the OnClick event. After the event it is set
properly.

Shouldn't the ItemIndex be correctly updated by the time the OnClick code runs? Like it is in Windows?

Looks like a bug (or at least, is inconsistent between platforms). Using OnItemClick works.

Can you report the problem, here?

https://quality.embarcadero.com/

--
Dave Nottage [MVP, TeamB]
Find hints, tips and tricks at Delphi Worlds blog: http://www.delphiworlds.com

I've just released an update to my component which may help. The ksVirtualListView is the component which could help. Lots more included.

https://bitbucket.org/gmurt/kscomponents

Kind regards,
Graham
Michael Leahy

Posts: 2
Registered: 11/10/17
Re: TListBox doesn't change ItemIndex when clicked in mobile?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 1, 2017 8:42 AM   in response to: Dave Nottage in response to: Dave Nottage
Reported here: https://quality.embarcadero.com/browse/RSP-19266

Dave Nottage wrote:
Michael Leahy wrote:

Delphi Tokyo 10.2

I drop a TListBox on a form in a new project. I add a few strings. I leave the ItemIndex set to -1.

I add an OnClick event which references the ItemIndex to get the highlighted string.

On Windows it gets the correct string.

On mobile (iOS and Android) the ItemIndex is still set to -1 during the OnClick event. After the event it is set
properly.

Shouldn't the ItemIndex be correctly updated by the time the OnClick code runs? Like it is in Windows?

Looks like a bug (or at least, is inconsistent between platforms). Using OnItemClick works.

Can you report the problem, here?

https://quality.embarcadero.com/

--
Dave Nottage [MVP, TeamB]
Find hints, tips and tricks at Delphi Worlds blog: http://www.delphiworlds.com
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02