I have a WebContainer that contains a WebButton.
The WebContainer can be instantiated in more than one WebDialog. The WebButton action should close the WebDialog the WebContainer is displayed in. How can I do that?
Feels like it should be something simple, but I can’t use Self.Close in the WebButton pressed event as that would refer to the WebContainer itself.
Also I could put the WebButton in the WebDialog itself and run Self.Close which should solve it, but I was wondering if there was a way to put the button in the WebContainer.
You can add an Event Definition to your container, let’s call it CloseDialog
The pressed event of the Button can RaiseEvent CloseDialog
The container in your Dialog will have Self.Close in CloseDialog event.
I’m not saying this is the right/best/only option but is easy to explain. I hope this is what you want.
That’s great thanks - seems like what I want! So essentially the button press event subsequently fires a pre-defined custom event belonging to the container. However what I do not understand is if CloseDialog is an Event Definition belonging to the container, then calling Self.Close would attempt to close the container and not the WebDialog?
Oops…although I knew that…I got it confused for a moment.
Anyway, here’s the sample file, but I think what you suggested would work so will try that. Thanks
A little annoying that there seems to be a bug with Event Definition. I can’t type anything into the code editor window. Plus the blinking text cursor is in the margin. I would have expected others to open a ticket about this so seems like it’s just affecting me? I will raise a ticket.