Referencing current container

I am looking for a way to reference the current container so I can dynamically get some datasets from the current containers chart.

I have looked at getSibling which does exactly what I want but I am working in the script module and I don’t believe you can use this function because it requires an event object. This script runs on a time interval and is not activated by an event…

Here’s what I have ended up doing:

domain = system.gui.getWindow('ProjectStatus').getRootContainer().getComponent(container) irrTbl = domain.getComponent('Chart').Irr
where ‘container’ is a variable passed in to the function that is the name of the current container I want to get dataset from.


Why don’t you just pass in the event object to the function? You can then just do:irrTbl = event.source.getComponent('Chart').Irr

I guess I just don’t get how to pass an ‘event’ object to my function without doing it in an Event Handler Script. I had been trying to do what you recommended but had not luck.

How do you pass an ‘event’ object to a function from the runScript function in the expression binding?

From everything I’ve read and tried it seems the Event Handler scripting module is the only way to use the ‘event’ objects. Am I mistaken?


Oh, I didn’t know you were doing it from a runScript. You can’t pass in the event object in the runScript since there is no event object. It only exists in Event Handlers like you said.

Unfortunately, with a run script you will have to tell the function which window and container to get the info from. I would add three arguments to your function like this:runScript("app.pkg.function('WindowName', 'ContainerName', 'ComponentName')", 5000)where your function will do the following:def function(windowName, contName, compName): domain = system.gui.getWindow(windowName).getRootContainer().getComponent(contName) irrTbl = domain.getComponent(compName).IrrThat is all you can do right now.

Ok, that’s basically how I’ve got it going. Just wanted to make sure I was not missing something.

Do you think there is enough need for you guys to implement a runScript function that can except various types of objects in the argument?

Thanks again for your help, Travis.