2020-10-02 05:13 AM
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
Solved! Go to Solution.
2020-11-04 09:44 PM
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
2020-10-04 05:32 PM
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
2020-11-04 02:55 AM
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
2020-11-04 09:44 PM
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