PDA

View Full Version : accessing subwindow1 from subwindow2



frostbyte000jm
April 13th, 2021, 21:49
I have, what is probably going to make me feel dumb asking, a question about how to access 1 subwindow from another.

so I am making a new sidebar window. In the window I have 2 subwindows: header and contents.

In header: I have my link, name, lock
in contents: I have some fields and a button.

Pressing the button will create a string that I want to place somewhere.

All this works just fine (kind of).

My issue that I am having is I want the button to also take the name of the window and use that as well.
using window.name.getValue(), doesn't work like it does for all my other strings that are in here (which I expected it not to). I can't figure out how to get from my container subwindow to my header subwindow to get name.

I am probably going to feel foolish when I get the answer.

Trenloe
April 13th, 2021, 22:07
Something like parentcontrol.window.<name of the subwindow>.subwindow.<control name>

You may not need to use parentcontrol, depending where your script is running.

frostbyte000jm
April 13th, 2021, 23:24
Thank You!

I felt like I tried every combo I could think of.

This is what I finally ended on:
local sName = window.parentcontrol.window.header.subwindow.name. getValue();