# Vertical scrolling in viewport using mouse wheel on template repeater

**URL:** <https://forum.inductiveautomation.com/t/vertical-scrolling-in-viewport-using-mouse-wheel-on-template-repeater/20157>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [October 15, 2018, 5:46pm UTC](https://forum.inductiveautomation.com/t/vertical-scrolling-in-viewport-using-mouse-wheel-on-template-repeater/20157 "2018-10-15T17:46:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bvaldovinos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bvaldovinos/32/6315_2.png) [@bvaldovinos](https://forum.inductiveautomation.com/u/bvaldovinos)\
**Post date:** [October 15, 2018, 5:46pm UTC](https://forum.inductiveautomation.com/t/vertical-scrolling-in-viewport-using-mouse-wheel-on-template-repeater/20157/1 "2018-10-15T17:46:19Z")

</div>

The scroll speed was really slow on my template repeater. After a bit of searching through the Ignition Forums, I found some helpful posts and comments that led me to implement the code shown below when the template repeater is loaded.

My issue is that I can only use the mouse-wheel to scroll vertically when the mouse-pointer where the scroll-bar is located. I would like to be able to scroll when the mouse is inside anywhere in the template repeater (the green box in my image). How do I make that happen?

```auto
if (event.source == "componentRunning"):
    from javax.swing import SwingUtilities
    from javax.swing import JScrollPane
    
    scrollPane = SwingUtilities.getAncestorOfClass(JScrollPane, event.source.getComponents()[1].getComponents()[2])
    scrollPane.getVerticalScrollBar().setUnitIncrement(50)

```

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/0eaac34c77f23fee85b74547644227e2b07c34d9.png)

---

<div class="post-metadata">

**Author:** ![mrogers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mrogers/32/4110_2.png) [@mrogers](https://forum.inductiveautomation.com/u/mrogers)\
**Post date:** [October 15, 2018, 11:57pm UTC](https://forum.inductiveautomation.com/t/vertical-scrolling-in-viewport-using-mouse-wheel-on-template-repeater/20157/2 "2018-10-15T23:57:04Z")

</div>

I’m not sure why it isn’t scrolling when the pointer is outside of the scroll bar, but I don’t think your propertyChange script is right. You’re checking if event.source == ‘componentRunning’ - should be event.propertyName == ‘componentRunning’.

---

<div class="post-metadata">

**Author:** ![bvaldovinos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bvaldovinos/32/6315_2.png) [@bvaldovinos](https://forum.inductiveautomation.com/u/bvaldovinos)\
**Post date:** [October 16, 2018, 4:02pm UTC](https://forum.inductiveautomation.com/t/vertical-scrolling-in-viewport-using-mouse-wheel-on-template-repeater/20157/3 "2018-10-16T16:02:00Z")

</div>

Oh, woops. I made that change, but still I am not able to scroll when the pointer is outside of the scroll bar.

---

<div class="post-metadata">

**Author:** ![ethomason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethomason/32/43338_2.png) [@ethomason](https://forum.inductiveautomation.com/u/ethomason)\
**Post date:** [October 16, 2018, 7:53pm UTC](https://forum.inductiveautomation.com/t/vertical-scrolling-in-viewport-using-mouse-wheel-on-template-repeater/20157/4 "2018-10-16T19:53:26Z")

</div>

I put this in the window’s internalFrameOpened event handler and it worked

```auto
repeater = system.gui.getParentWindow(event).getComponentForPath('Root Container.Template Repeater')
repeater.getComponents()[1].getVerticalScrollBar().setUnitIncrement(50)

```

---

<div class="post-metadata">

**Author:** ![bvaldovinos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bvaldovinos/32/6315_2.png) [@bvaldovinos](https://forum.inductiveautomation.com/u/bvaldovinos)\
**Post date:** [October 23, 2018, 9:23pm UTC](https://forum.inductiveautomation.com/t/vertical-scrolling-in-viewport-using-mouse-wheel-on-template-repeater/20157/5 "2018-10-23T21:23:27Z")

</div>

Hi @ethomason - I think I marked this as a solution prematurely. I can tell that this code is working somewhat because my scrolling increments change successfully. But for any scrolling to occur at all, I have to place my mouse pointer exacly on the scrollbar. I’d like to be able to scroll when my mouse is anywhere on the template repeater.

---

<div class="post-metadata">

**Author:** ![ethomason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethomason/32/43338_2.png) [@ethomason](https://forum.inductiveautomation.com/u/ethomason)\
**Post date:** [October 23, 2018, 9:27pm UTC](https://forum.inductiveautomation.com/t/vertical-scrolling-in-viewport-using-mouse-wheel-on-template-repeater/20157/6 "2018-10-23T21:27:00Z")

</div>

Do you have code running anywhere else? Ignition version? The code works fine for me with my mouse over anywhere on the template repeater.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 23, 2018, 9:30pm UTC](https://forum.inductiveautomation.com/t/vertical-scrolling-in-viewport-using-mouse-wheel-on-template-repeater/20157/7 "2018-10-23T21:30:23Z")

</div>

Do you have tooltips (mouseover text) on any of the components/the template itself in the repeater?

---

<div class="post-metadata">

**Author:** ![bvaldovinos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bvaldovinos/32/6315_2.png) [@bvaldovinos](https://forum.inductiveautomation.com/u/bvaldovinos)\
**Post date:** [October 24, 2018, 11:30pm UTC](https://forum.inductiveautomation.com/t/vertical-scrolling-in-viewport-using-mouse-wheel-on-template-repeater/20157/8 "2018-10-24T23:30:15Z")

</div>

I don’t have tooltip, but I do have a script that runs on mouseEntered for some text inside each template instance. In the photo above, I have mouseEntered text on _Hand Add_ and _Saute._

---

<div class="post-metadata">

**Author:** ![bvaldovinos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bvaldovinos/32/6315_2.png) [@bvaldovinos](https://forum.inductiveautomation.com/u/bvaldovinos)\
**Post date:** [October 24, 2018, 11:31pm UTC](https://forum.inductiveautomation.com/t/vertical-scrolling-in-viewport-using-mouse-wheel-on-template-repeater/20157/9 "2018-10-24T23:31:38Z")

</div>

There’s some code on each template. Each small white box inside every template is a clickable checkbox. There’s scripting associated with each one.
