Components set to visible are not displayed

I tried to make a demo of the problem I describe here but the demo works as expected. So, I’ll have to describe the problem as best as I can.

I have a page (call it WebPageReused) that has many overlapping components on it and these are resused many times within the app. The idea is that I have a lot of pages that are very similar so I am trying to minimize the number of times I have to add components by reusing them.

WebPageReused has a video window (customhtmlviewer), an htmlviewer, and a textfield component that are on top of each other. Not sure that matters; just thought I should mention it.

The problem is that when I set the textfield to visible, it isn’t showing up unless I set a timer to wait for 1 second and then show the text field. I don’t know why 1 second is needed and I am not confident that this is a good “fix”. I am concerned that the delay will be variable and longer when the app is deployed to the web.

In RB (Desktop app), I remember using a me.parent=nil command to prevent multiple components from getting “linked together” that were on top of one another and getting hidden incorrectly. Is there a similar command in Xojo? I am thinking maybe the textfield stays hidden because it is in the same

as the other components and the entire div is hidden. Just a guess. I’ll see if I can find that out tomorrow.

Maybe I need to consider doing explicit instances. From what I have read, I should do that anyway to make the app more efficient.

If I need to, I’ll work at making a demo that shows the problem but like I said no luck (yet) getting the demo to show this missing textfield problem. By the way, I don’t think it is unique to textfield, it’s just the current problem I am having. Also seems to be a problem for the htmlviewer and video window.

Thom’s response on this page explained a way to make pages more efficient. I decided it would be a good idea to use this method regardless of whether or not it solved the problem with components not getting displayed. So, instead of calling WebPageReused over and over again to show or hide components, set text, etc, I am using this to declare a new page: Dim NewPage as New WebPageReused. Then, all settings on the page are made using this NewPage variable.

I don’t have any idea why, but the page is working fine now. Any explanation why this might be?