Hi all,
We have a programming challenge where we have a child panel which represents an object. There are multiple objects present in the system and they possess an ordering. For example, the objects could be valves along a pipe ordered 1, 2, 3... n.
On the child panel we need two buttons, one which opens the popup for the upstream object and one which opens the popup with the downstream object.
For the user this should ideally appear seamless and open the new panel in exactly the same place as the existing panel. It should really look like the same child panel has been refreshed with a new dollar parameter.
Is this possible? That is, can a child panel be refreshed with a new dollar parameter instead of being closed then opened again? If so, how?
The reason for wanting to do this, instead of just closing the panel then opening a fresh child panel, is that the child panel which represents the object can be called from multiple locations within the project. Calling the panel again from the parent panel would require passing some parameters down and would involve a variety of complications.
Kind regards,
Angus Heyworth
How to Refresh Child Panel with New Dollar Parameter?
- AngusETM
- Posts:37
- Joined: Tue Apr 25, 2017 4:48 pm
How to Refresh Child Panel with New Dollar Parameter?
- mkoller
- Posts:741
- Joined: Fri Sep 17, 2010 9:03 am
Re: How to Refresh Child Panel with New Dollar Parameter?
A ChildPanel can also have public functions (in the scopeLib) which can be called from any other script.
What you can do is to not use any $-Parameter at all but instead open the child panel, call a public function passing arguments which would currently be $-params.
Then when you want to change the arguments, just call that public function again, and deal with the newly passed arguments, e.g. disconnect the old DPs, connect to the new ones, etc.
What you can do is to not use any $-Parameter at all but instead open the child panel, call a public function passing arguments which would currently be $-params.
Then when you want to change the arguments, just call that public function again, and deal with the newly passed arguments, e.g. disconnect the old DPs, connect to the new ones, etc.
- AngusETM
- Posts:37
- Joined: Tue Apr 25, 2017 4:48 pm
Re: How to Refresh Child Panel with New Dollar Parameter?
Hi Martin,
Thanks for your response. That's a good idea, although I'm not sure whether it will work in our case.
The panel contains many sub-panels which are themselves common display objects used throughout the project, so they themselves still need $-parameters.
This idea could work if it's possible for the function we call to re-assign the $-parameter inside the panel, but I'm not sure that this can be done?
Regards,
Angus
Thanks for your response. That's a good idea, although I'm not sure whether it will work in our case.
The panel contains many sub-panels which are themselves common display objects used throughout the project, so they themselves still need $-parameters.
This idea could work if it's possible for the function we call to re-assign the $-parameter inside the panel, but I'm not sure that this can be done?
Regards,
Angus
- mkoller
- Posts:741
- Joined: Fri Sep 17, 2010 9:03 am
Re: How to Refresh Child Panel with New Dollar Parameter?
You can't change the $ params except by opening the panel again.
Changing $-params alone would not help, since the scripts which use the $-params would need to start again, which they do on opening the panel.
Or you pass the parameters via public functions where you then make sure the new values are used where needed.
Changing $-params alone would not help, since the scripts which use the $-params would need to start again, which they do on opening the panel.
Or you pass the parameters via public functions where you then make sure the new values are used where needed.