Embedded Module panel accessibility

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
Search

Post Reply
6 posts • Page 1 of 1
SebastianR
Posts: 5
Joined: Fri Nov 09, 2018 12:32 pm

Embedded Module panel accessibility

Post by SebastianR »

Hello everyone, I'll just be straightforward:
I have a panel/window which contains a tree view and an Embedded Module and a button - based on the selection in the tree view I load panels into the Embedded Module - and pressing said button I want to call a public function within the Scope Lib of the panel which is loaded into the Embedded Module.
Is it possible to do this or is the Embedded Module not made for this use case?

So far I tried getShape()/getShapes() on the Embedded Module but I could only ever get shapes which are inside the panel which is loaded into the Embedded Module, not the panel itself.
I was unlucky regardless, because even though I declared public functions within a shape in its Initialize scope, I still wasn't able to call it.
Additionally I switch the panels in and out using RootPanelOnModule() which doesn't need a shape name, which makes using getShape(s) a bit more difficult.

The most obvious thing to do is to just try and call the shape directly on button press, which won't work as well, as was expected.

The help doesn't really provide any in-depth information about Embedded Modules and searching the forum yielded no relevant posts to me, so here I am.

Has anyone done this before?
Do I just have to use addSymbol() instead and throw away the Embedded Module?

Any help is appreciated!
Kind regards,
Sebastian

Image

User avatar
mkoller
Posts: 741
Joined: Fri Sep 17, 2010 9:03 am

Re: Embedded Module panel accessibility

Post by mkoller »

it is possible. You can call any public function from any panel, regardless if it's loaded in a Module either embedded or not, even opened in a child panel.
Do it like this:
invokeMethod("embeddedModuleName.PanelNameInside:", "publicFunctionName", argument1, argument2);

The key here is: how to address the panel itself, which is the usual syntax ".:" (don't forget the colon at the end)

SebastianR
Posts: 5
Joined: Fri Nov 09, 2018 12:32 pm

Re: Embedded Module panel accessibility

Post by SebastianR »

Hey Martin!

Thanks for your answer, this works perfectly!

Also thanks to Gertjan for fixing the picture in the original post, I somehow got that wrong..

philipp.wechsler
Posts: 13
Joined: Tue May 17, 2016 2:27 pm

Re: Embedded Module panel accessibility

Post by philipp.wechsler »

The invokeMethod it's nice to use.
I have only a timing problem. The invokeMethod works only if I have a delay of more than 10ms between the RootPanelOnModule and the invokeMethod.

Code: Select all

RootPanelOnModule( ... );
delay( 0, 10 );
invokeMethod( ... );
Is there another solution that work without a delay? Or an action when the panel has finished loading on the module?

SebastianR
Posts: 5
Joined: Fri Nov 09, 2018 12:32 pm

Re: Embedded Module panel accessibility

Post by SebastianR »

Hey Philipp!

I recommend using the Initialize event within the panels which you are loading in RootPanelOnModule().
If you need some parameters you can always pass them as parameters within the RootPanelOnModule() call as well.

Edit:
To give an example:

RootPanelOnModule("mypanel", "myId", "myModule", makeDynString("$param:" + myparam));

philipp.wechsler
Posts: 13
Joined: Tue May 17, 2016 2:27 pm

Re: Embedded Module panel accessibility

Post by philipp.wechsler »

I can't transfer a ctrl++ object by the $-parameter for initialize. That's the reason that I need the public method after loading.

https://portal.etm.at/index.php?option= ... 6&id=10257

Post Reply
6 posts • Page 1 of 1