59
Views
10
Comments
How to enable a button when you scroll till the end

Hello, please help. How do you enable a button when the user has scrolled to the end of the page on the mobile? The answer in this link does not work for me 

2024-12-02 13-16-47
Vipin Yadav

Hi @Matanong ,

Could you please share your OML file so I can review it and provide feedback?

Thanks,

Vipin Yadav

UserImage.jpg
Matanong

Hello, this is the oml. I am using mobile, btw. Thank you.

TestMobile.oml
2022-12-30 07-28-09
Navneet Garg

you can compare total record count and list current count and if both are equal then you can add condition to the button

2023-11-22 10-51-50
Jozy Sohail

Hi matanong,

you can use the lists OnScrollEnding action to enable disable the 

hope it helps,

UserImage.jpg
Matanong

It is not possible in my use case since I am using a ck editor, and is being loaded into a container

2024-01-04 09-21-21
Venkatesaiya

Hi @Matanong ,
Please refer this Page this will helps you 
how-to-enable-a-button-in-a-popup-when-you-reached-the-bottom

UserImage.jpg
Matanong

Still not working. If anyone has an idea, feel free to chip in. Thank you.

2025-07-22 10-30-27
Mandar Deshpande

Hi @Matanong 

Can you try below steps:

  1. Set your button’s Enabled property to false by default.
  2. Select the container(Name = EditorContainer) where CKEditor is loaded.
  3. Use below JavaScript (after the container loads)

var container = document.getElementById("EditorContainer");

if (container) {

  container.addEventListener("scroll", function () {

    if (container.scrollTop + container.clientHeight >= container.scrollHeight) {

      // Send message to OutSystems to enable the button

      $public.FeedbackMessage.sendMessage("EnableButton");

    }

  });

}

Handle this message in OutSystems.

4. On the screen, add an OnMessage handler with logic:

              If Message = "EnableButton", Assign IsButtonEnabled = True, which was false at the start.

5. This will make the button clickable once the user reaches the bottom.

2025-09-28 15-31-59
Claudio Barra

Hi @Matanong,

You can achieve this using the Intersection Observer API, which is much more reliable than manually checking scroll positions, especially on mobile devices.

Here’s a simple example in JavaScript that you can use in OutSystems to enable a button when the user scrolls to the end of the page:


const sentinel = document.getElementById($parameters.SentinelId);

const observer = new IntersectionObserver((entries) => {

  entries.forEach(entry => {

    // Trigger even if the sentinel is partially visible

    if (entry.isIntersecting || entry.intersectionRatio > 0) {

      $actions.EnableButton();

      observer.unobserve(sentinel); // Stop observing after the first trigger

    }

  });

}, { root: null, threshold: 0.1 });

observer.observe(sentinel);


  • $parameters.SentinelId is the ID of an invisible element placed at the end of your page.

  • $actions.EnableButton() is a Client Action you create in OutSystems to enable the button.

  • Using threshold: 0.1 ensures the action triggers even if the sentinel is only partially visible, which is more reliable on mobile.

I will also attach an OML example so you can see it working directly in OutSystems.

This approach avoids manual scroll calculations and works smoothly across devices.

IntersectionObserver.oml
2025-12-29 06-17-15
Deepak Raj M

Hi, you can use js and achieve the concept you are trying

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