Shown event does not fire in WebPage subclass starting with Xojo2020r1

I am diving in to Web 2.0. After getting everything to compile properly, I am having a problem with the Shown event. It seems if I subclass WebPage and then implement the Shown event in that subclass, it does not fire. However, if the Shown event is implemented in the WebPage class it works properly.

Seems like I am missing something obvious.

Edit: It seems that if I define a webpage (lets say WebPage2) and then create a subclass for WebPage2, events defined in that subclass will work. So essentially, I am prevented from putting anything between my screen layout and the WebPage class. I use this extensively so would prefer a resolution to above, but understand with Event Definitions and overriding methods I can communicate with common code subclasses that could mirror what I am currently doing with a little work, and the presence of these methods and event definitions in every new page I create.

xojo web 2 before 2021r2 if bug full. don’t try anything with it or be prepare to loose time !

It fails all the way to 2021r3.1.

My second observation won’t be feasible as a workaround I don’t think. I can’t think of an easy way to subclass it further and use common code in the process across most of my screen layouts.

did you create an event definition for “shown” and call it from the superclass with raiseevent ?
I have main class for webpages, and all my pages are subclasses of this super, and it works fine.

Steps to reproduce:

  1. New Web project. Drag WebButton on to WebPage1
  2. Create a class and call it WebCommon with WebPage as its Super
  3. Create another Webpage (defaults to WebPage2) and make WebCommon its super
  4. Implement Shown event (Insert->Event Handler) in WebCommon. Put a line of code in it with a breakpoint
  5. In the Pressed event of WebPage1.Button1 put the following code
    Dim win as new WebPage2
  6. I expect the event implemented in step 4 to fire when the button is pressed. It does not. It fires on Xojo2019r3.2 and earlier

This might be limited to just the Shown Event. Other events such as Opening seem to work when defined in the subclasses of WebPage. Jean do you use the Shown event?

Try adding a Shown Event Definition to WebCommon.

I’m not sure I understand why that works, but it does. Thanks Alberto

in fact not ! I did a subclass of a webpage for my pages, but there is nothing in it !
I’m more using webdialogs, and here I made a master webdialog superclass with lots of events in it.