-
February 26th, 2023, 18:57 #1
- Join Date
- Aug 2020
- Posts
- 94
Retrieve GUI element from DB node
It is probably a simple question, but I can't figure out how to do it anymore.
I know how to go from the GUI element to the DB node, just a matter of calling getDatabaseNode().
But how do I go back from the node to the GUI element?
In particular, I am trying to fix my extension after the recent FG update and I need to go from database node { charsheet.id-00001.powers.id-00001 } to the <windowclass name="power_item">.
Thank you in advance!
-
February 26th, 2023, 19:00 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,563
You cannot retrieve a UI element from a database node. You can only go in the other direction, as the relationship for databasenodes to controls is one to many.
You'll have to perform the modifications in the scripts for the windowclass or controls that you need to act differently.
Regards,
JPG
-
February 26th, 2023, 19:54 #3
- Join Date
- Aug 2020
- Posts
- 94
Thank you, that is what I was afraid of.
Is it, maybe, possible to grab control using Interface.findWindow, or will this also not work?
-
February 27th, 2023, 01:59 #4
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,563
You can do that, but that means you have to grab the top-level window and drill all the way down to the correct control through all the subwindows and lists. I wouldn't suggest it for long term, since it would be more likely to break than other parts of the code.
What are you trying to do?
Regards,
JPG
-
February 27th, 2023, 11:01 #5
- Join Date
- Aug 2020
- Posts
- 94
Thank you for the clarification.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks