cancel
Showing results for 
Search instead for 
Did you mean: 

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

GAlia.1
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
Alexandre RENOUX
Principal

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

View solution in original post

3 REPLIES 3
Alexandre RENOUX
Principal

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
Associate II

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
Principal

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