72
Views
7
Comments
Solved
How to enable a button in a popup when you reached the bottom of scrollable area?
Question
Service Studio Version
11.54.53 (Build 63220)

Hi to all! I am just curious if you someone has already done this. If you do, may I know how you did it? And may I know if you can share an oml file where I can base my project to?

2022-11-25 09-50-05
Diogo Carvalho
Solution

Hello @Irapohl Cruz ,

I attach .oml bellow, please check if solve you problem.


I add this to OnRender (using SetBooleanTrue ClientAction to change Boolean var and show button):
const element = document.getElementById($parameters.PopupID);let lastScrollTop = 0;element.onscroll = (e)=>{if (element.scrollTop < lastScrollTop){      // upscroll       return;   }    lastScrollTop = element.scrollTop <= 0 ? 0 : element.scrollTop;    if (element.scrollTop + element.offsetHeight>= element.scrollHeight ){        $actions.SetBooleanTrue();    }}

I don't know you want to disable button, but you can change that later.

Hope this works for you,
DC

TestPurpose.oap
UserImage.jpg
Irapohl Cruz

Hi Diogo! Thank you for sharing this, and I really appreciate your response. But I'm experiencing an error "cannot set properties of null (setting 'onscroll')". May I know where the problem might be?

UserImage.jpg
Irapohl Cruz

Does this work on mobile apps too?

UserImage.jpg
Irapohl Cruz

Hi! I managed to make it work! Thank you so much for your help! Though I'm still getting the same error.

UserImage.jpg
Irapohl Cruz

Hi @Diogo Carvalho, may I know how I can resolve this error "cannot set properties of null (setting 'onscroll')" ? I forgot to mention that I'm developing a mobile app.

2024-12-02 12-15-17
Aravind EONE
UserImage.jpg
Irapohl Cruz

Hi! Thank you for providing this alternative. This is much appreciated. In my case, Diogo's shared solution works best for me. Hope to learn more from you.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.