PDA

View Full Version : Retrieve GUI element from DB node



xelab
February 26th, 2023, 18:57
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!

Moon Wizard
February 26th, 2023, 19:00
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

xelab
February 26th, 2023, 19:54
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?

Moon Wizard
February 27th, 2023, 01:59
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

xelab
February 27th, 2023, 11:01
Thank you for the clarification.