# Alarm status table: scrollbar width and return to top in marquee mode \[vision\]

**URL:** <https://forum.inductiveautomation.com/t/alarm-status-table-scrollbar-width-and-return-to-top-in-marquee-mode-vision/67653>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [December 15, 2022, 8:07am UTC](https://forum.inductiveautomation.com/t/alarm-status-table-scrollbar-width-and-return-to-top-in-marquee-mode-vision/67653 "2022-12-15T08:07:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [December 15, 2022, 8:07am UTC](https://forum.inductiveautomation.com/t/alarm-status-table-scrollbar-width-and-return-to-top-in-marquee-mode-vision/67653/1 "2022-12-15T08:07:16Z")

</div>

Hi guys, I have a couple of question about the Alarm Status Table in Vision.

I have a touchscreen where I show the main alarms of the plants.. The questions are:

1. How can I change the size of the vertical scrollbar (with the touch is quite difficult to move it)
2. I set the Alarm Table in marquee mode but I would like to disable it when I have new alarms active; this is not a problem, I can manage it, but I don't know how I can return to the top, because as soon as I disable the marquee mode it freezes in the row without moving the view to the top.

Thanks for the help.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [December 15, 2022, 10:27am UTC](https://forum.inductiveautomation.com/t/alarm-status-table-scrollbar-width-and-return-to-top-in-marquee-mode-vision/67653/2 "2022-12-15T10:27:20Z")

</div>

> [@Aiasa21](#):
>
> How can I change the size of the vertical scrollbar

I was able to accomplish this from a button on my alarm status table using the following code:

```auto
from java.awt import Dimension
scrollPane = event.source.parent.getComponent('Alarm Status Table').getComponent(0).getComponent(0).getComponent(1).getComponent(0)
scrollPane.getVerticalScrollBar().setPreferredSize(Dimension(100, 0))

```

The code gets the scroll pane and directly sets the preferred width of the vertical scroll bar.  
**Here is the result:**  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/4/946b697a9454608b93287dd47fe9c4e1d81c708a.png)

> [@Aiasa21](#):
>
> how I can return to the top

This button actionPerformed script works on my alarm status table:

```auto
from java.awt import Point
viewPort = event.source.parent.getComponent('Alarm Status Table').getComponent(0).getComponent(0).getComponent(1).getComponent(0).getComponent(0)
viewPort.setViewPosition(Point(0,0))

```

It gets the viewport and sets the position to zero.

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [December 15, 2022, 10:35am UTC](https://forum.inductiveautomation.com/t/alarm-status-table-scrollbar-width-and-return-to-top-in-marquee-mode-vision/67653/3 "2022-12-15T10:35:24Z")

</div>

Thank you very much for your help, this is exactly what I need.

May I ask you could I know how all the .getComponent(index) works?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [December 15, 2022, 10:48am UTC](https://forum.inductiveautomation.com/t/alarm-status-table-scrollbar-width-and-return-to-top-in-marquee-mode-vision/67653/4 "2022-12-15T10:48:48Z")

</div>

Most components are actually a groups of nested components. If you take a component and use the method `getComponents()`, a list of subcomponents will be returned. To get a specific subcomponent in the list an index can be specified: either `.getComponents()[index]` or simply `getComponent(index)`  
To find a type of component in this way, it is possible to drill down level by level using something like:

```auto
for subComponent in component.getComponents():
	print type(subComponent)

```

---

<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:** [December 15, 2022, 4:13pm UTC](https://forum.inductiveautomation.com/t/alarm-status-table-scrollbar-width-and-return-to-top-in-marquee-mode-vision/67653/5 "2022-12-15T16:13:23Z")

</div>

There's a 'Scrollbar Width' property where you enable touchscreen mode in the project properties:  
[https://docs.inductiveautomation.com/display/DOC81/Vision+Project+Properties#VisionProjectProperties-VisionGeneralProperties](https://docs.inductiveautomation.com/display/DOC81/Vision+Project+Properties#VisionProjectProperties-VisionGeneralProperties)

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 15, 2022, 4:26pm UTC](https://forum.inductiveautomation.com/t/alarm-status-table-scrollbar-width-and-return-to-top-in-marquee-mode-vision/67653/6 "2022-12-15T16:26:50Z")

</div>

Extending this, here's what I used to use in Vision to see what all the components in IA components are:

```auto
# traverse all components within an object and print them and their component index reference to the screen
def printAllObjectComponents(object, indexPrefix = '', indent = ''):
	components = object.getComponents()
	for index, component in enumerate(components):
		print "%s %s%s %s" % (indent, indexPrefix, index, component)
		
		printAllObjectComponents(component, indexPrefix + str(index) + '.', indent + '\t')

```

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [December 15, 2022, 4:50pm UTC](https://forum.inductiveautomation.com/t/alarm-status-table-scrollbar-width-and-return-to-top-in-marquee-mode-vision/67653/7 "2022-12-15T16:50:19Z")

</div>

> [@nminchin](#):
>
> here's what I used to use in Vision

Very nice! I like how the output is tabbed to illustrate the nesting level.
