self.self.self

I want to simply move backward in controls: label1 to the container it’s in to the container the first container is in.

I tried self.self and self.parent. both failed.

Is there a way to do this in Xojo? (particularly for the web)

.Parent is probably what you are looking for

in a control use me to refer to the control. self is the container.

so me.parent = self usually.

As a test self.parent.name = containerCreateRoutines:

msgbox self.parent.label1.text

Error:

Type “WebView” has no member named “label1” . . . The container does have a label1.

Type “Int32” has no member named “text”

Parameter “message” expects type string, but this is type Int32

self.parent is the parent OF the container (assuming this code is at the container level)

you should just need self.label1.text (and actually at that level… just label1.text as self should be implied)

if you are refering label1 in container1 but doing it from container2 (which would have to have the same parent as container1)
THEN is would be
parent.container1.label1.text

If you use Parent, then you have to cast it to the right class in order to address its contents.

self.Parent is a generic window and knows nothing about Label1

containerCreateRoutines(self.Parent) recognizes Label1.

That’s unfortunate Tim. The hope was not to have to tell the app exactly which container to go to

You can use isA to figure out which one it is.

  • karen

You can also implement a Class Interface so they all look alike.