Work Around for WebControl.Page Returning Nil

I’m posting a work around to the feedback issue discussed in this forum post, 29484 Page Property Of Control On WebToolbarContainer Returns Nil.

Simply download this Xojo module and add it to your web project. Then call FindPageTD instead of Page in code where Page is returning Nil.

FindPageTD has to search all of the controls on all of the pages for the session. A typical Xojo web app is not going to have thousands of open pages with thousands of controls on each page in a single session, so performance should not be an issue. Still, I would call FindPageTD once in a function and store the result in a variable. I wouldn’t repeatedly call it like you might call Page.

I’m releasing this under the MIT License.

Leave a Reply

Your email address will not be published. Required fields are marked *