Skip to main content
GAlia.1
Associate II
October 2, 2020
Solved

How to be able to drag a scrollList, when reimplementing the handleClickEvent of the item custom container?

  • October 2, 2020
  • 3 replies
  • 1214 views

Hello,

I have built a scroll list, where each item is a custom container that has an image and a textArea. I want to be able to call a callback from the item when the respective item is clicked. For example, I want to change the color of the custom container background when the item is clicked, as shown in the attached picture. I am able to do that by implementing the handleClickEvent function inside the custom container. However, once I do that, I can not drag the list.

Can you please help me on how to be able to still drag the scrollList when I overwrite the handleClickEvent on the custom container?

Thanks a lot.

Bests,

Gazi

This topic has been closed for replies.
Best answer by Alexandre RENOUX

Hello,

Actually for what you are trying to achieve I would highly recommend to use a List Layout inside a Scrollable Container. This way you also have the scrollbar already implemented.

You will find enclosed a rough example to show you.

When your question is answered, please close this topic by choosing Select as Best.

/Alexandre

3 replies

Alexandre RENOUX
Visitor II
October 5, 2020

Hello,

Are you sure it's not because you implemented handleClickEvent() in your ScreenView ?

Because it it's the case, you should call the base class handleClickEvent() function at the end.

void ScreenView::handleClickEvent(const ClickEvent& evt)
{
 // Code
 ScreenViewBase::handleClickEvent(evt);
}

/Alexandre

GAlia.1
GAlia.1Author
Associate II
November 4, 2020

Hello Alexandre,

Sorry for the late reply, but I have been very busy with other things.

Coming to your answer, I am sure I have not implemented the handleClickEvent() in the view. I implemented it in the component of the scrolllist.

However I think there is a solution to my problem. It is related to the events of the scrollList. Right now, there is a selectedItemCallback() for all the lists. This callback is called though only in the RELEASE clickEvent. Is there a way to call a callback in case of the PRESSED clickEvent for the scrollList?

Thank you.

Bests,

Gazi

Alexandre RENOUX
Alexandre RENOUXBest answer
Visitor II
November 5, 2020

Hello,

Actually for what you are trying to achieve I would highly recommend to use a List Layout inside a Scrollable Container. This way you also have the scrollbar already implemented.

You will find enclosed a rough example to show you.

When your question is answered, please close this topic by choosing Select as Best.

/Alexandre