Array of containers with different supers

Hi all,

Interesting little problem that I am not sure about.
Typically in a web app I will create some form of table in a db that allows user access control - typically tabs that when clicked load a page or embed a container. The tabs are generated on the fly from a web container, having a property called “myvalue” which was assigned a value while iterating through a loop from the returned recordset. The action event of the dynamic control passes myvalue to a method in the main webpage. I then use select case to identify the container I wish to interact with. No issues there and it works well, except for the fact it takes others working on my projects some time to come up to speed.

It became clear that the code was fairly spread out and I went to see if I could make things easier. I created an array on the main webpage in the hopes I could add all the containers and reference them through the array when required - removing the need for embed methods. Initially they were all set as not visible and I would pass a value to a method “ShowContainers” as such;

for i as Integer = 0 to 2 if i = val then ccArray(i).ZIndex = 10 ccArray(i).Visible = True else ccArray(i).ZIndex = 0 ccArray(i).Visible = False end if next

So if I passed the value 1 it would hide all others and set zindex to 0 except for the required page.
This was so much easier than a huge select case with 15 options.

The problem is this does not work. When I click the tab it shows a page but that’s it, subsequent clicks on other buttons results in nothing being shown.
I think this has something to do with creating an array of containers that have different supers?
Maybe its a zindex issue?
Maybe its right in front of me and I am stupid?

Maybe I need new devs!

Also interested in ways others load dynamic content and or show different webpages.

(Just realized I cannot attach - email me from the test example)

Is this a control set ? That definitely won’t work

If it’s dynamically created containers you still have to call embed within

Yes sorry it is a control set.
There is no issue loading dynamically and embedding.

I figured if its just a control set I could just toggle visible property - no need to embed, alas I guess this is not true.

Interestingly to get them into the control set I had to drag the control into the webpage and manually change its name rather than click on the gear wheel in inspector and assign it to the control set. Maybe this behaviour should be prevented if this does not work.

[quote=81709:@Chris Musty]
Interestingly to get them into the control set I had to drag the control into the webpage and manually change its name rather than click on the gear wheel in inspector and assign it to the control set. Maybe this behaviour should be prevented if this does not work.[/quote]

Yeah its an IDE bug that it lets you create this at all
Don’t

The alternative of course is to just embed them in the IDE and reference them that way but I will have to go back to the good old select case rather than a tight little loop like above!

Need a feedback for this one?

Nope see #33147
Already fixed for a future release

Thanks for the help Norman

You can do both. Embed them in the IDE and then append them to an array in page Open.

Did not even consider this.
Would have thought this would create a separate instance but I am guessing the array would just be a reference to the object.

Correct. Just another reference.